EK9300 - CoE data access over PROFINET
Description
CoE means Can over EtherCAT. It enables access to all parameters of an EtherCAT device. The CoE data model is based on the principles of CANopen and uses index and subindex for reading from and writing to parameters, if the corresponding access is enabled.
Further information can be found here: System Documentation
Task
Parameters of an EtherCAT device can generally be set and parameterized via the parameters of the GSDML file. However, in some applications it is necessary to change certain parameters at runtime or to carry out optimizations during operation.
Solution
The CoE data are sent via acyclic PROFINET services (PROFINET index 0x200F). The position of the EtherCAT device is specified via the slot number. The CoE data are then entered in the record data. During reading they consist of CoE index and CoE subindex, during writing they consist of CoE index, CoE subindex and the data to be sent.
Reading/writing sample
For reading, a WriteReq record must be sent first. This includes the CoE index and CoE subindex. After the WriteRsp a ReadReq has to be sent in order to retrieve the data, which are then contained in the ReadRsp.
Writing takes place in the same way, except that WriteReq includes the data, and ReadRsp serves as acknowledgement to indicate whether writing was successful.
Getting Started - Reading
PROFINET record data (write request) |
Value |
Meaning |
---|---|---|
Slot |
Position of the EtherCAT device (1...255) |
Slot number, position of the EtherCAT device |
SubSlot |
1 |
Sub-slot number, always "1" |
Index |
0x200F |
PROFINET index number |
Length |
4 |
Length of the following data |
Data |
Bytes 1 and 2 SDO index |
CoE data |
Delay time, we recommend 100..250 ms until the read request is sent, which includes an acknowledgment of error-free writing.
PROFINET record data (read request) |
Value |
Meaning | |
---|---|---|---|
Slot |
Position of the EtherCAT device (1...255) |
Slot number, position of the EtherCAT device | |
SubSlot |
1 |
Sub-slot number, always "1" | |
Index |
0x200F |
PROFINET index number | |
Length |
Write |
Answer |
Length of the following data |
Data |
Write |
Answer |
CoE data |
The response to the read request, i.e. the read response, includes the data. The first 4 bytes contain the error code. This is "0" if the response is error-free. The error code is an ADS error code. Further information can be found under the following link.
http://infosys.beckhoff.com/content/1031/tcsample/html/ads_returncodes.htm
Wireshark sample for reading (Download file)
Getting Started - Writing
PROFINET record data (write request) | Value | Meaning |
---|---|---|
Slot | Position of the EtherCAT device (1...255) | Slot number, position of the EtherCAT device |
SubSlot | 1 | Sub-slot number, always "1" |
Index | 0x200F | PROFINET index number |
Length | 4 | Length of the following data |
Data | Bytes 1..2 SDO index | CoE data |
Delay time, we recommend 250..500 ms until the read request is sent, which includes an acknowledgment of error-free writing.
PROFINET record data (read request) | Value | Meaning | |
---|---|---|---|
Slot | Position of the EtherCAT device (1...255) | Slot number, position of the EtherCAT device | |
SubSlot | 1 | Sub-slot number, always "1" | |
Index | 0x200F | PROFINET index number | |
Length | Write | Answer | Length of the following data |
Data | Write | Write | CoE data |
The response to the read request, i.e. the read response, includes confirmation that writing was successful. The first 4 bytes contain the error code; "0" indicates error-free response. The error code is an ADS error code. Further information can be found under the following link (system documentation).
Wireshark sample for writing (Download file)
Observe data format During reading and writing, observe the data size and the format of the corresponding SDO parameters. We recommend reading the SDO data first, then interpret them and use the read data format also for writing the CoE data (perhaps swap High/Low BYTE/WORD). |
Start-up parameters overwrite CoE data CoE data are typically not stored in the EtherCAT device. Ensure that start-up parameters (GSDML) overwrite the CoE data during startup of the EK9300. |