IMDHMIControls LibraryShop main store

Explainer

Why CODESYS reaches an Ethernet E1 brain over Modbus TCP

Industrial networks Published 5 min read

Short answer

Use Modbus TCP, not MMP, for CODESYS on an EPIC controller to reach an Ethernet E1 brain: the Opto CODESYS library defines EPIC-to-EPIC I/O only, and no library definitions exist for legacy E1 I/O. The documented proof of concept used CODESYS V3.5 SP15 Patch 4 with EPIC firmware 1.5.0, Modbus TCP included, in Ladder Logic.

On this page
  1. Can CODESYS reach an E1 brain over OptoMMP?
  2. Which versions were proven to work?
  3. How does an E1 map its I/O to Modbus?
  4. What does a read look like in Ladder Logic?
  5. How does this fit with a gateway or register-gap fault?
  6. What is the decision for each case?
  7. Questions asked

When an Optomux B1 serial brain is replaced by an Ethernet E1 brain, the question is which protocol carries the I/O into CODESYS on a groov EPIC controller. The answer is Modbus TCP, not MMP: the E1 has Modbus TCP built in, the EPIC version of CODESYS includes the Modbus TCP feature, and a documented proof of concept ran the exchange in Ladder Logic under CODESYS V3.5 SP15 Patch 4 on EPIC firmware 1.5.0.

Can CODESYS reach an E1 brain over OptoMMP? #

No; use Modbus TCP. The Opto CODESYS library carries full device definitions for EPIC I/O only, which is why EPIC-to-EPIC traffic can run over MMP: the library has already defined every point. No such definitions exist for legacy E1 or E2 I/O, so the MMP route to an E1 is unavailable in CODESYS, and the proof-of-concept author used Modbus for exactly that reason.

The practical consequence is that you give up one thing and keep another. You give up the point-and-click I/O mapping that the Opto library provides for EPIC modules, where a channel appears in the project tree and can be dragged into logic. You keep full access to every E1 memory location, because Modbus TCP exposes the brain's map directly and the CODESYS master blocks read and write it. On a machine with a handful of analog channels and some digital points, that trade is small: you write the register numbers once, document them next to the program, and the wiring diagram does the rest.

Which versions were proven to work? #

The documented proof of concept used CODESYS V3.5 SP15 Patch 4 on a groov EPIC running firmware 1.5.0. Everything needed came with the EPIC's version of CODESYS: the Modbus TCP feature is included, no extra package or license step appears in the documented configuration, and the exchanges were written in Ladder Logic. On newer firmware, treat the path as expected to work but retest the actual exchanges before trusting them on a running machine.

When you retest, do it in this order: confirm the E1 answers a ping on the plant network, confirm the TCP port 502 connection opens from the EPIC, then run one read of a known register while forcing the field signal at the terminal. If the read follows the force, the path is proven for your pair of versions and you can build the rest of the program on it.

How does an E1 map its I/O to Modbus? #

The E1 uses the Modbus function code plus the register number to select the memory location in the brain, not a fixed block per module. The register number alone is ambiguous until you pair it with the function code: the same number can mean a coil, a discrete input, an input register or a holding register. The full memory map is in the E1 and E2 documentation, form 1563, and the Modbus/TCP protocol guide, form 1678, covers the EPIC side. Take every address from that map for the installed brain; do not derive registers from the module layout by assumption.

What does a read look like in Ladder Logic? #

A worked example, illustrative only: say the E1 map assigns one analog input channel to input register 3 (function code 04). In the CODESYS Modbus TCP master, set the unit ID to the E1's Modbus address on that TCP connection, the function code to 04, the count to 1, and the starting register to the value your master block expects. Check the block's convention: many CODESYS Modbus masters take a zero-based register offset, so input register 3 in the manual becomes a start value of 2 (3 minus 1). If the returned 16-bit word is 8,192 counts and the channel is 0 to 65535 over a 0 to 10 V signal, the voltage is 8192 divided by 65535, times 10 V, which is 1.25 V. Force the channel at the terminal and confirm the word follows before building the rest of the program on that mapping.

Do the offset check once and write the answer down next to the block, because an off-by-one register reads a neighbouring channel: the value still looks plausible, the scaling still computes, and the loop controls the wrong point. A quick guard is to force two adjacent channels to clearly different levels and confirm the two returned words land where the map says they should.

How does this fit with a gateway or register-gap fault? #

The E1 is a Modbus TCP slave on the wire, so the CODESYS side is an ordinary client. If the E1 sits behind a gateway, the client setup follows the same path as setting up a CODESYS Modbus TCP client through a gateway, and a read that straddles unmapped E1 registers returns exception 02, the case covered in Modbus exception 02 when a read crosses a register map gap. When you address the received word inside CODESYS, what %IW0 means for a Modbus TCP holding register explains where process image addressing stops and register addressing begins.

What is the decision for each case? #

  • New CODESYS project on EPIC with E1 or E2 brains: Modbus TCP, using the documented memory map, on the proven firmware pair or a retested newer one.
  • EPIC to EPIC: MMP is fine, because the Opto library defines the points; Modbus TCP also works when you prefer one protocol everywhere.
  • Existing Optomux B1 migration: replace with E1 brains and move the I/O to Modbus TCP; do not wait for MMP definitions for legacy I/O, since none have been published.

Questions asked

Can CODESYS talk to an E1 brain using OptoMMP?

Not in the documented implementation. MMP works EPIC-to-EPIC because the Opto CODESYS library fully defines the EPIC I/O; equivalent definitions for legacy E1 or E2 I/O have not been published, so the working path is Modbus TCP.

Do I need an extra Modbus TCP package for CODESYS on EPIC?

No. The Modbus TCP feature is built into the EPIC version of CODESYS as demonstrated with firmware 1.5.0 and CODESYS V3.5 SP15 Patch 4; no additional package or license step is documented.

Which versions were proven for the EPIC-to-E1 proof of concept?

CODESYS V3.5 SP15 Patch 4 on a groov EPIC running firmware 1.5.0, programmed in Ladder Logic. Reproduce that pair when validating the path, and retest any newer firmware before trusting it on a running machine.

How many registers can I read from an E1 in one Modbus request?

The request size is bounded by the Modbus specification, not by the brain family: a single read can carry up to 125 registers or 2000 coils and discrete inputs. Split larger reads into several requests, and check that each request stays inside one mapped area so a gap does not return exception 02.

Keep reading

  • How-to

    Driving a WAGO 750-653 Modbus RTU module from CODESYS

    On a CODESYS Control Win V3 soft PLC, WagoAppPlcModbus cannot reach a 750-653 behind a 750-354 EtherCAT coupler, because those blocks need WAGO controller firmware. Drive the module's raw process image yourself: set the serial parameters, move each fragment with the control/status byte toggle handshake, and frame the Modbus RTU request and response in your task. Each fragment costs at least two task cycles, so a full transaction takes ten cycles or more.

    Industrial networks

  • How-to

    Configure MicroLogix 1100 Channel 0 for Modbus RTU

    On the tested MicroLogix 1100 (1763-L16BBB rev. B), Channel 0 is a serial port with a selectable driver — DF1, Modbus RTU Slave or Modbus RTU Master — set in RSLogix Micro under Channel Configuration while Channel 1 keeps carrying Ethernet. Slave mode creates the data files, binary for coils and contacts and integer for input and holding registers; master mode runs MSG instructions against the stations you poll.

    Industrial networks

  • How-to

    How a PLC runs two Modbus networks at the same time

    Yes. Each serial port is its own independent link: the HMI polls the PLC on one port while the PLC acts as master, or slave, on a separate RS-485 Modbus RTU network. The two links share no settings — only their endpoints must match — and PLC copy logic moves any data between them.

    Industrial networks