USB & RS232 Communication
Data Link Layer
EPOS4 Communication Guide
CCMC | 2019-11 | rel8759
2-13
2.2.2
Frame Structure
The data bytes are sequentially transmitted in frames. A frame composes of…
•
synchronization (and byte stuffing),
•
header,
•
variably long data field, and
•
16-bit long cyclic redundancy check (CRC) for verification of data integrity.
Figure 2-5
USB/RS232 communication – Frame structure
Note
As a reaction to a bad OpCode or CRC value, the slave sends a frame containing the corresponding error
code.
For an example on composition and structure of EPOS4 messages
chapter “2.2.9 Example: Command
SYNC
The first two bytes are used for frame synchronization.
DLE
Starting frame character “DLE” (Data Link Escape) = 0x90
STX
Starting frame character “STX” (Start of Text) = 0x02
HEADER
The header consists of 2 bytes. The first field determines the type of data frame to be sent or
received. The next field contains the length of the data fields.
OpCode
Operation command to be sent to the slave. For details on the command set
“EPOS4 USB & RS232 Command Reference” on page 2-7.
Len
Represents the number of words (16-bit value) in the data fields [0…143].
DATA
The data fields contain the parameters of the message. The low byte of the word is
transmitted first.
Data[i]
The parameter word of the command. The low byte is transmitted first.
CRC
16-bit long cyclic redundancy check (CRC) for verification of data integrity.