FSoE frame structure explained by examples
One byte of safety data: The simplest safety PDU
This contains just one safety data instance, consisting of only one byte
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 1 byte | Command | Command |
| 1 | 1 byte | SafeData[0] | safety data, octet 0 |
| 2 | 2 byte | CRC_0 | 16-bit CRC |
| 4 | 2 byte | Conn_Id | unique connection ID |
All multi-byte fields are stored in little endian.
FSoEShortestSafetyPDU.h
struct __attribute__((packed)) FSoEShortestSafetyPDU {
uint8_t Command;
uint8_t SafeData_0;
uint16_t CRC_0;
uint16_t Conn_Id;
};Two bytes of safety data
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 1 byte | Command | Command |
| 1 | 1 byte | SafeData[0] | safety data, octet 0 |
| 2 | 1 byte | SafeData[1] | safety data, octet 1 |
| 3 | 2 byte | CRC_0 | 16-bit CRC |
| 5 | 2 byte | Conn_Id | unique connection ID |
All multi-byte fields are stored in little endian.
FSoETwoByteSafeDataPDU.h
struct __attribute__((packed)) FSoETwoByteSafeDataPDU {
uint8_t Command;
uint8_t SafeData_0;
uint8_t SafeData_1;
uint16_t CRC_0;
uint16_t Conn_Id;
};Four bytes of safety data
| Offset | Size | Name | Description |
|---|---|---|---|
| 0 | 1 byte | Command | Command |
| 1 | 1 byte | SafeData[0] | safety data, octet 0 |
| 2 | 1 byte | SafeData[1] | safety data, octet 1 |
| 3 | 2 byte | CRC_0 | 16-bit CRC 0 |
| 5 | 1 byte | SafeData[2] | safety data, octet 2 |
| 6 | 1 byte | SafeData[3] | safety data, octet 3 |
| 7 | 2 byte | CRC_1 | 16-bit CRC 1 |
| 9 | 2 byte | Conn_Id | unique connection ID |
All multi-byte fields are stored in little endian.
FSoEFourByteSafeDataPDU.h
struct __attribute__((packed)) FSoEFourByteSafeDataPDU {
uint8_t Command;
uint8_t SafeData_0;
uint8_t SafeData_1;
uint16_t CRC_0;
uint8_t SafeData_2;
uint8_t SafeData_3;
uint16_t CRC_1;
uint16_t Conn_Id;
};Source: ETG.5100 S (D) V1.2.0, Table 4: Shortest safety PDU and Table 3: General Safety PDU, available on request from the EtherCAT Technology Group (ETG)
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow