Program EtherCAT® networks with IEC 61131-3 using OpenPLC
The EC-Master Feature Pack OpenPLC integrates the acontis high-performance EtherCAT MainDevice stack with the open-source OpenPLC Runtime and Editor — bringing graphical PLC programming to industrial-grade EtherCAT network control.
Everything you need to control EtherCAT I/O from an IEC 61131-3 program
The Feature Pack provides a integration between the EC-Master protocol stack and OpenPLC — from automatic process data mapping to remote diagnosis.
- Automatic process data mapping: Process data variables from the EtherCAT Network Information (ENI) file are automatically mapped to IEC 61131-3 located variables. INPUTs flow from the network to the PLC buffers, OUTPUTs flow from the PLC to the network — no manual address configuration required.
- One-click process data export: The EC-Engineer exports the complete process data layout in OpenPLC format. Paste the variable declarations directly into the OpenPLC Editor's code view and start programming with named, typed variables for every channel in your EtherCAT network.
- Custom C/C++ function blocks: Access the full EC-Master API from within your IEC 61131-3 program. Included examples for emGetMasterState and emGetSlaveState let you monitor network health directly on the FBD canvas.
- Dual-layer diagnosis: Debug from both sides simultaneously. The OpenPLC Editor provides live variable inspection and value forcing on the PLC logic side. The EC-Master RAS server lets the EC-Engineer connect remotely to monitor and force process data on the EtherCAT side — all while the system keeps running.
- Independent real-time cycle thread: The EcMasterDemoOpenPlc plugin runs the EtherCAT bus cycle in its own high-priority thread, fully decoupled from the OpenPLC scan cycle. This preserves the sub-millisecond timing precision of the EC-Master stack regardless of PLC program complexity.

Architecture - How the components work together
The EcMasterDemoOpenPlc plugin bridges the EC-Master's real-time EtherCAT cycle with the OpenPLC Runtime's IEC 61131-3 execution engine through cyclic process data synchronization. ENI XML flows into XML Parser, which feeds Process Data Mappings and EC-Master core. The EC-Master communicates through the EtherCAT Real-time Ethernet Driver to the physical network. Process data is synchronized cyclically with the OpenPLC Runtime buffers, where the IEC 61131-3 program executes. The plugin runs its own cycle thread for real-time EtherCAT communication while synchronizing process data with the OpenPLC Runtime buffers.

Why this integration matters
Combining a commercially proven EtherCAT stack with an open-source IEC 61131-3 environment creates advantages.
- Graphical programming for EtherCAT: Engineers who think in Function Block Diagrams or Ladder Logic can now program EtherCAT I/O visually, without writing C/C++ application code. Variable blocks appear as drag-and-drop elements wired to real EtherCAT I/Os.
- Industrial performance, open tooling: The EC-Master handles demanding real-time communication — distributed clocks, hot connect, cable redundancy — while OpenPLC provides a standards-based programming environment accessible to any automation engineer.
- Full IEC 61131-3 data type coverage: Boolean, 8-bit, 16-bit, 32-bit, and 64-bit data types — signed and unsigned — are mapped automatically from the ENI file. The variable addressing follows the standard %I/%Q location scheme familiar to any PLC programmer.
- Extensible via native EC-Master API: When standard process data access isn't enough, C/C++ function blocks give direct access to the entire EC-Master API from within the PLC program — query slave states, trigger transitions, read diagnostics, all from the FBD canvas.
- Remote commissioning via RAS: The built-in Remote Access Service (RAS) server lets the EC-Engineer connect to the running EtherCAT network over TCP. View live process data, force outputs, and monitor performance — without stopping the system or being physically present.
What you gain in practice
From first prototype to field deployment, the Feature Pack accelerates every stage of the project lifecycle.
- Minutes from ENI file to running PLC: Export the process data layout from the EC-Engineer, paste it into the OpenPLC Editor, wire up logic blocks, compile, and deploy. A working control program for real EtherCAT hardware can be operational in a single session.
- Lower barrier for automation engineers: Teams familiar with IEC 61131-3 can work with EtherCAT networks without needing deep C/C++ skills. The open-source OpenPLC Editor eliminates per-seat license costs for the programming tool.
- Production-grade network performance: The underlying EC-Master stack is deployed in thousands of industrial applications worldwide. Support for optimized real-time Ethernet drivers with direct hardware access to the Ethernet MAC ensures deterministic communication even at demanding cycle times.
- Fits the acontis ecosystem: Works seamlessly with the EC-Engineer for network configuration, ENI file generation, and remote diagnosis via the RAS protocol. Compatible with any EC-Master Real-time Ethernet driver for maximum deployment flexibility.
Summary
- Operating systems: Microsoft Windows, Linux
- OpenPLC compatibility: OpenPLC Runtime v4, OpenPLC Editor (all five IEC 61131-3 languages)
- Plugin architecture: Native shared library (.so / .dll) loaded by the OpenPLC Runtime via plugins.conf
- Process data types: BOOL, SINT/USINT, INT/UINT, DINT/UDINT, LINT/ULINT — mapped automatically from the ENI file
- Data synchronization: INPUTs: EC-Master → OpenPLC buffers, OUTPUTs: OpenPLC buffers → EC-Master, Separate buffers per data type (per OpenPLC standard)
- Diagnosis: OpenPLC Editor debug mode (live variable inspection & forcing) + EC-Master RAS server (default port 6000) for remote EC-Engineer access
- Custom function blocks: C/C++ examples included. Extensible via the full EC-Master API with setup() / loop() hooks.