6.7. MainDevice Variables
MainDevice variables are an EC-Master extension that allows applications to trace data in real time on the network. To ensure real-time transmission, it is implemented as part of the cyclic process data. They are placed behind the SubDevice output data in the output area of the process data image of the EtherCAT® application. The MainDevice variables can be configured via the ENI with the help of the EC-Engineer.
MainDevice variables can be captured with a network monitoring tool like Wireshark.
To transfer the data, an additional NOP command is appended to the end of the cyclic EtherCAT® frame. The NOP command has ADP 0 and ADO 0x4154. The EC-Master automatically fills the data area of the NOP command with the current MainDevice variables when sending cyclic frames. Since the MainDevice variables are transferred to the network as NOP command, they are not evaluated by any ESC. Therefore, the WKC of the MainDevice variables remains 0 and the application cannot validate the data.
The easiest and most comfortable way to create MainDevice variables is with the help of the EC-Engineer.
The necessary NOP command and the process data variables are automatically created and exported to the ENI. The process variables can be accessed as usual using the emonFindOutpVarByNameEx() function.