SERCOS file format of the backup file

1. File header of the type ST_SercosFileHeader

2. n * data
a) Parameter header of the type ST_ParamHeader
b) Parameter data as bytes

Sample for n parameters

1 * ST_SercosFileHeader (268
Bytes)


-----------------------------------------------------

nVersion     ( 4 Bytes)

nListType    ( 4 Bytes)

cbCommentLen ( 4 Bytes)

sComment     ( 256 Bytes)


n * (ST_SercosParamHeader + Data)

-----------------------------------------------------

nIDN         ( 2 Bytes)

cbSize       ( 2 Bytes)

nAttrib      ( 4 Bytes)

arrData      (cbSize Bytes),
kann für jeden Parameter verschieden groß sein, je nach Typ oder
Listenlänge 

Sample for 3 parameters

ST_SercosFileHeader (268 Bytes)
----------------------------------------------------------------------------
nVersion ( 4 Bytes), i.e. = 01 00 00 00 (= 1)
nListType ( 4 Bytes), i.e. = 00 00 00 00 
cbCommentLen ( 4 Bytes), i.e. = 00 00 00 00 (= 0)
sComment ( 256 Bytes), i.e. = 00 00 00 00 00 00 00 ... 00
(256 * 00)
1st parameter ST_SercosParamHeader + Data (10 Bytes)
----------------------------------------------------------------------------
nIDN ( 2 Bytes), i.e. = nnnncbSize( 2 Bytes), i.e. = 02 00 (= 2)nAttrib ( 4 Bytes), i.e. = xx xx xx xx
arrData     (2 Bytes), i.e. = 12 342nd parameter ST_SercosParamHeader + Data (16 Bytes)

----------------------------------------------------------------------------
nIDN ( 2 Bytes), i.e. = nnnncbSize( 2 Bytes), i.e. = 08 00 (= 8)nAttrib( 4 Bytes), i.e. = xx xx xx xx
arrData ( 8 Bytes), i.e. = 12 34 56 78 9a bc de f03rd parameter ST_SercosParamHeader + Data (12 Bytes)
----------------------------------------------------------------------------
nIDN ( 2 Bytes), i.e. = nn nncbSize ( 2 Bytes), i.e. = 04 00 (= 4)nAttrib ( 4 Bytes), i.e. = xx xx xx xx
arrData ( 4 Bytes), i.e. = 12 34 56 78 

TYPE ST_SercosFileHeader (268 bytes)

The file header of the Sercos backup file is based on the ST_SercosFileHeader structure.

TYPE ST_SercosFileHeader :
STRUCT
    nVersion      : UDINT;(* 4 Bytes *)
    nListType     : UDINT;(* 4 Bytes *)
    cbCommentLen  : UDINT;(* 4 Bytes *)
    sComment      : T_MaxString;(* 256 Bytes *)
END_STRUCT
END_TYPE

Name

Type

Description

nVersion

UDINT

Contains the file version, momentarily 1.

nListType

UDINT

Contains the IDN parameter list that was used for the backup. The default value is 192 (list of all backup parameters), with a user-defined backup list this is 0. Alternatively, the list of all SERCOS parameters (IDN 17) can be used. However, the restore requires the list from parameter 192 or the user-defined list (0).

cbCommentLen

UDINT

Length of the comment of the backup file.

sComment

T_MaxString

Comment of the backup file. The string is written with all 256 characters.

TYPE ST_SercosParamHeader (8 bytes)

The file header is followed by a parameter header of type ST_SercosParamHeader for each parameter in the backup file.

TYPE ST_SercosParamHeader :
STRUCT
    nIDN     : UINT;(* 2 Bytes *)
    cbSize   : UINT;(* 2 Bytes *)
    nAttrib  : DWORD;(* 4 Bytes *)
END_STRUCT
END_TYPE

Name

Type

Description

nIDN

 

Sercos parameter number.

cbSize

 

Length of the data in bytes that follow this header. Can be different for each parameter, depending on the parameter type or list length.

nAttrib

ST_SercosParamData

Attribute of the Sercos parameter, is required to determine the length and data type.

Parameter data (cbSize bytes)

The data directly follow each Sercos parameter header in the backup file. The number of data bytes is saved in the parameter header in cbSize.

Requirements

Development environment

Target platform

IO hardware

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC (x86)

Sercans SCS-P ISA; Sercans SCS-P PCI;
Beckhoff FC750x PCI

Tc2_IoFunctions (IO)