EC-Monitor: Software library for monitoring (sniffing) of EtherCAT® networks
Overview
With the EC-Monitor software library it is possible to analyze and evaluate the data traffic of an EtherCAT network. The library records the EtherCAT frames and provides the decoded data to a customer application. The process data (inputs and outputs), the slave states, the slave error counters, and other important EtherCAT data are extracted from the EtherCAT frames.
The library can be used independently of the master controller and works with EtherCAT masters from many manufacturers (Beckhoff, Omron, Bosch-Rexroth, Lenze, ACS Motion Control, acontis, etc.). EC-Monitor analyzes the complete data traffic between the master and the EtherCAT slaves via a TAP (Test Access Point) device inserted after the master. The TAP device enables both the outgoing frames (Master → Slaves) and the incoming frames (Master ← Slaves) to be recorded and evaluated.
Analyzing and Decoding of EtherCAT Protocol based on network configuration file (ENI)
The recorded EtherCAT frames are decoded based on what is included in the EtherCAT Network Information (ENI) file. This file contains the definition of the process image, all variables including the data types, as well as the structure of the cyclic frames. The ENI file is part of the EtherCAT specification ETG.2100 and can be generated by any EtherCAT configuration software. Usually the ENI file is required by the EtherCAT master anyway, so this means that there is no additional engineering effort.
System Architecture
A Test Access Point (TAP) must be inserted into the existing EtherCAT network to capture the EtherCAT frames. The TAP is recommended to be placed between the master and the first slave, but it can also be installed between any two slave devices. However, it is only possible to completely analyze all input and output data when the TAP is installed immediately after the master, because some data (LRW commands) are overwritten by the downstream slave's subsequent input data. The TAP device (e.g. Dualcomm ETAP-1000), should have a short propagation delay in order not disturb the overall network timing.
With the EC-Monitor library, there is no need to intervene in the network, control, the EtherCAT master software, or the configuration. EC-Monitor is therefore suitable for new installations (greenfield) as well as for existing systems and machines (brownfield).
Software Architecture
The EC-Monitor library can be used on numerous operating systems like Windows, Linux, QNX, and more without any modifications. The network controller is connected via a special driver from acontis known as the link layer. High-performance link layers designed specifically by acontis for use with EC-Monitor are available for numerous Ethernet controllers.
EC-Monitor processes the ENI file and uses it to determine a variety of aspects of the system like the number of slaves, the structure of the process image, the variable names, and the variable offset in the process data image. Based on this data, the application can dynamically adapt to different network configurations.
Programming interfaces and Example code
C / C++ API
The EC-Monitor API is very similar to the EC-Master API, which also allows a fast learing curve as well as re-using existing software modules.
All relevant steps to get access to the EtherCAT data is shown in the included “EC-Monitor Demo”.
MQTT
MQTT is a widely used IIoT protocol that enables easy and secure transmission of data, which is supported by many supervision tools and data-concentrators. It also offers good cybersecurity, as all traffic is securely routed via the pre-defined MQTT broker and can be encrypted. In addition, the architecture of the EC-Monitor together with the usage of TAPs makes sure that your EtherCAT network is protected against unauthorized access.
By using the included EcMonitorDemoMqtt example, the EC-Monitor can publish all EtherCAT variables (process data) as different topics – making it easy to directly reuse the real-live values from the EtherCAT variables in many software solutions that can work with MQTT data. To enable detailed EtherCAT diagnosis, the EcMonitorDemoMqtt includes the EtherCAT timestamp in the message, providing insight into timing behavior of the network. To reduce the TCP/IP load, the messages will be published based on a pre-defined cyclic update time or upon detected data change.
As the EcMonitorDemoMqtt is included in sources, it can easily be modified to fit to the specific needs of the application – e.g. removing the timestamps or adding filters.
Use Cases
Use Case: Diagnosis Tool
The EC-Monitor library provides the necessary data from the network for an EtherCAT diagnostic software to be created by the customer. In addition to displaying the topology and process data, this tool can also be used to localize communication faults. As long as the EtherCAT master software is regularly checking the slave error counter register, this data can also be decoded by the EC-Monitor and made available to the application for further processing. For example, the location and cause of possible errors can be determined from the slave, along with port-specific error counters (bad cables or faulty plug connections), and the results can be displayed graphically. The acontis EC-Inspector is an example of such a tool.
Use Case: IIoT Gateway, (Embedded) Edge Device
A popular use case of the EC-Monitor is the continuous, EtherCAT controller-independent supervision of EtherCAT control networks. This allows to realize true predictive maintenance as all relevant process data can be monitored, analyzed and tracked – helping to generate alerts in case of strange or abnormal process data or network errors.
The EC-Monitor allows multiple ways of this supervision:
- Live, on-line supervision by direct forwarding the relevant data to a supervision sever which either directly processes the data and/or stores it for future use.
The connection between the EC-Monitor and the server can be done either by MQTT using the EcMonitorDemoMqtt or via any other protocol that only needs to be added on top of the EC-Monitor as part of the customer application. - Off-line monitoring: The EC-Monitor can trace all process variables directly onto a storage device, e.g. as csv file. This allows the tracing within networks where no remote network is available.
An important feature of the EC-Monitor library is the lossless recording of all process data. This is a prerequisite for implementing applications for quality assurance (condition monitoring) or for predictive maintenance. The recorded data can then be analyzed and processed with appropriate algorithms, e.g., on a PC or in an embedded device. The information collected may afterwards be forwarded to a central server or to a cloud. The monitoring of the manufacturing process is, among other things, a prerequisite for the complete traceability of a product.
Use Case: Observation of critical applications with a “Supervisor” System
The EC-Monitor library allows the complete investigation of the entire process data of an EtherCAT network in real-time. For safety-critical applications, this data can be validated by an application on another system. This monitoring system thus controls the main application and can take appropriate measures to shut down the main controller in the event of a fault.
Features
- Analyzing and Decoding the EtherCAT Protocol
- Utilizes the EtherCAT Network Information (ENI) file
- Monitoring of Process Data Variables
- Monitoring of Slave States
- Monitoring of Slave Error Counters (ESC registers 0x300 to 0x313)
- Processing of previously captured raw network traffic (Wireshark files)
- Save raw network traffic in a PCAP (Wireshark) file
Advantages
- No integration with an existing master controller required
- Suitable for New (Greenfield) and Existing (Brownfield) installations
- No specific TAP required, even a regular switch device may be used
- No impact (e.g. timing, load) on the existing application
- No changes to existing software required
- Very small engineering effort: simply use the existing ENI file
- Use the same software to analyze machines operated by controllers from different manufacturers (Beckhoff, Bosch-Rexroth, Omron, Yaskawa, etc.)
Recommended TAP (Test Access Point) Devices
- Dualcomm, Zero-Delay Fast Ethernet Copper ETAP-1000
- PROFITAB, ProfiShark 100M
- PROFITAB, ProfiShark 1G
- Beckhoff, Industrial Ethernet multichannel probe ET2000
More information
Data sheets and evaluation versions are available in the download area.