OpenEC-Diagnostics
Open Source, C#, .NET, EtherCAT, Industrial Automation, Diagnostics

OpenEC-Diagnostics

Free, open source EtherCAT monitoring and diagnostics for .NET. It watches a live network or reads a capture file, decodes the traffic, and shows what each device is doing, all without acting as the master.

Description

EtherCAT is a fast industrial network that connects a controller (the master) to the devices on a machine, such as drives, I/O modules, and sensors. When something goes wrong, engineers need to look inside that traffic. The tools that do this well have traditionally been expensive and closed.

OpenEC-Diagnostics is a free, open source alternative written in modern C# and .NET. It listens to EtherCAT traffic and explains it, so you can troubleshoot a machine, check its state, and verify the data it exchanges.

The most important idea is that it is passive. It only reads traffic. It never sends anything onto the network. That means you can attach it to a running machine without any risk of disturbing it. It works next to any master (such as TwinCAT, Acontis, IgH, or SOEM) and the devices of any vendor.

The project comes in three parts:

  • OpenEC.Monitor (the SDK): A C# library that decodes raw EtherCAT frames. It reads live traffic through a network TAP (a small device that copies the traffic on a cable) or from a saved .pcap / .pcapng capture file. It gives you a clean C# API for device states, process data, and error counters.
  • openec (the CLI): A command line tool for headless work. It lists capture interfaces, analyses capture files, monitors a live interface, and can generate synthetic sample captures to practice on.
  • OpenEC.Inspector (the GUI): A cross-platform desktop app built with Avalonia. It shows the bus as a device tree with a live status dot for the master and each device, a tabbed editor for state and decoded variables, and a topology view that draws the network as a physical map with the link state of each port.

What it does:

  • Passive monitoring: Listens through a standard network TAP without interfering with the master or the devices. There is no risk of disrupting the machine.
  • Deep decoding: Reads EtherCAT datagrams, working counters, the mailbox protocols (CoE, FoE, EoE, SoE), and process data.
  • ENI support: Loads an ENI.xml file so raw bytes turn into named, readable variables.
  • Learning mode: If no ENI is available, it can rebuild the bus configuration by watching the startup traffic, then export that as a real ENI file. A learned bus is cached, so you can attach to an already running machine later and still read its process data.
  • Offline analysis: Opens Wireshark-style .pcap and .pcapng captures for study after the fact.
  • Cross-platform: Runs on Windows, Linux, and macOS on .NET 8.

The project is licensed under Apache 2.0.

GitHub: https://github.com/patdhlk/OpenEC-Diagnostics

Used Tools and Technologies

  • C# / .NET 8
  • Avalonia
  • EtherCAT
  • SharpPcap / libpcap / Npcap
  • ENI / ESI XML
  • Network TAP
  • Windows
  • Linux
  • macOS