Analysis of EtherCAT telegrams
Below, examples of logged telegrams will be analyzed and compared with the configuration used.
Logging
Line 1 of the ET2000 being used is placed between the IPC and the EK1100 coupler, because the aim of this examination is to determine the extent to which all slaves change the transmitted frames. This can best be logged directly on the EtherCAT Master.
The ET2000 uplink is connected to the Gbit interface of a CP6920.
Information on data logging Logs >> 100,000 frames may under certain circumstances overload the RAM of the PC being used. It may be necessary to insert filters in order to reduce the amount of accumulated data. A PC with a conventional hard disk should be used for logging, not one with a CF card. |
Position of the data log A meaningful interpretation of the logged data is usually only sensible or possible if the place of connection is known. Hence, a connection between the master and the first slave, between Ethernet devices or even at the end of a topology can be meaningful, depending on the aim of the examination. Since 4 lines are available in the ET2000, Ethernet telegrams can be recorded at up to 4 different places simultaneously. |
Interpretation
Configuration
The TwinCAT configuration shown in fig. "Configuration and transmitted EtherCAT datagrams" is used here.
The EtherCAT Master (A) transmits an Ethernet frame with the process data (B) cyclically every 1 ms. This frame contains 5 EtherCAT datagrams (C). These datagrams are automatically calculated in the TwinCAT-EtherCAT Master. The calculation can be influenced in the 'Advanced Settings' or by SyncUnits.
The 2nd datagram, ‘LWR’, will be taken here as an example. This “Logical Write” is 1 byte long (Len = 1) and is located in the 4.2 GB EtherCAT address space at the logical address 0x10800 (D). One or more EtherCAT slaves must process this datagram in passing. After all slaves have done this successfully, the datagram must come back with a WorkingCounter = 1 (E).
The entire Ethernet frame encompasses 94 bytes (F) and, in the 1 ms cycle used with a length/duration of 9.44 µs, still allows a great deal of space for further process data or acyclic/queued telegrams.
Whereas the acyclic telegrams can change during the application runtime, the cyclic telegrams in the TwinCAT-EtherCAT Master are unchangeable as a rule. This simplifies the interpretation of the logs.
Information about the slave
We shall now consider the EL2008 slave. From its “Advanced Settings” -->FMMU/SM, fig. "EL2008 mapping settings", we can see:
- that it uses only 1 FMMU (Fieldbus Memory Management Unit) (B),
- which transfers 1 byte (length = 1)
- from the logical address space at byte 0x10800 (C)
- from bit 0 (L Start: “.0”)
- to bit 7 (L EndBit = 7)
- into the Slave’s physical RAM memory after address 0x0F00 (D).
These settings are made automatically by the TwinCAT-EtherCAT Master.
The LWR at log. 0x10800 must now be sought in the telegram logs.
Logs
The EtherCAT datagrams can be found again immediately in the Wireshark log, fig. "Wireshark log". Several thousand frames have been logged here; we will take as examples frame no. 4855 (output from the Master with a clock time of approx. 1 ms) and no. 4856 (returning from the field several µs later, depending on the scope of the configuration).
Time column display It is often helpful to have the interval between two consecutive packets displayed in the Time column, see fig. "Wireshark log". This can be set under View --> TimeDisplayFormat. |
Usability of the Time column The information in the “Time” column can only be evaluated meaningfully if the frames were logged by the ET2000, since it gives each frame an HW time stamp – if the Wireshark .dll is installed as described, then this time stamp will also be displayed in the Time column. The time of arrival of the frame will otherwise be used at software level in the Ethernet driver of the logging PC on the basis of the operating system time in an ms raster. In addition, the order in the log will in this case usually be changed to a massive extent – the user must then first of all determine the correct order, e.g. using the index field in the EtherCAT datagrams.Therefore, the use of the ET2000 simplifies/accelerates the interpretation of the data considerably. |
The outgoing frame no. 4855 carries 5 commands/datagrams (C). The ET2000 suffixes the ESL/EtherCatSwitchLink information (16 bytes) with the time stamp (D). As a result, the frame grows to a length of 110 bytes (B).
Of interest is now the LWR at 0x10800, which is the second datagram according to fig. "EL2008 mapping settings" (B). The EtherCAT parser integrated in Wireshark allows the information to be represented as in fig. "Datagram interpretation" – the 2nd datagram is marked, as a result of which the bytes associated with it are highlighted in the 100 byte raw data field. The datagram begins with the datagram type (LWR = x0B); the sequential index follows, in this case x02. Further information on the EtherCAT protocol can be found in the documentation at www.ethercat.org.
Of particular interest here is also the WorkingCounter = 0 – all datagrams output from the Master carry Wc=0.
The EL2008 process data, 1 byte, can also be found in the datagram, see fig. "EL2008 process data".
In frame no. 4856 (A), when it returns from the field after 2 µs, all WorkingCounters have changed; these must now correspond to the expected values from fig. "Configuration and transmitted EtherCAT datagrams".