IMDHMIControls LibraryShop main store

Troubleshooting

Why an Ethernet/IP gateway process image needs an application copy

Industrial networks Published 8 min read By IMDHMI controls team

Short answer

The PiBridge puts the EtherNet/IP gateway into the RevPi process image as an independent module and never synchronizes it with the Modbus TCP master's words. Read the exact variable names configured in PiCtory, prove each direction with piTest, then run an application — Python with revpimodio2, raw access to /dev/piControl0, or Node-RED with byte-to-word conversion — that copies values between the two areas.

On this page
  1. Why the PiBridge does not copy gateway data
  2. Symptoms and what each one rules out
  3. Read the names PiCtory actually configured
  4. Prove each direction before writing the copy
  5. Copying one Modbus TCP word into two gateway output bytes
  6. What the offset is for, and where the copy runs
  7. The decision for each case
  8. Questions asked

If a RevPi polls a Modbus TCP slave and the CompactLogix sees nothing but zeros through the EtherNet/IP gateway, the missing piece is not the EDS file, the connection, or the PiBridge — it is an application copy. The PiBridge places the gateway in the RevPi process image as an independent module and keeps each module in step with its own area only; it never synchronizes one module with another. The Modbus master's words and the gateway's data area are two separate regions, and only software you run connects them. Read the variable names your PiCtory configuration actually defines, prove each transfer direction with piTest, then run a small copy loop — Python with revpimodio2, raw access through /dev/piControl0, or Node-RED — that moves values between the two areas. The worked example below copies one 16-bit Modbus word into the gateway's two output bytes and reads the value the PLC receives to tell a copy fault from a connection fault.

Why the PiBridge does not copy gateway data #

On the PiBridge, the EtherNet/IP gateway is an independent device that owns its own area of the process image, exactly like every other I/O module. The virtual Modbus TCP master owns a different area. The runtime keeps each module in step with its own area and with nothing else, so reading Input_Word_0 over Modbus TCP updates the master's area and never touches the gateway's area. That is the whole fault: while SSH shows live Modbus values, the CompactLogix reads a gateway area that nothing has written.

Installing the EDS file and creating the I/O module configure the network side only; neither action creates the internal transfer. The gateway's maker documents the same conclusion: the data is not synchronized automatically, and the synchronization belongs in your own application, for example in Python with revpimodio2.

Symptoms and what each one rules out #

  • Modbus values change in SSH or piTest, CompactLogix words stay zero — acquisition and the Modbus poll work; the internal copy is the missing piece.
  • piTest calls a variable name unknown — that name is not in the active process image; read the configured name from PiCtory before touching the Ethernet side.
  • A value forced from a CompactLogix output appears in the gateway's received area — the PLC-to-gateway direction works for that location.
  • A value written on the RevPi reaches the CompactLogix input tag — the gateway-to-PLC direction works; if read-back is correct but the tag stays at zero, the copy loop has stopped or lost its source.
  • Values arrive huge or shifted — a 16-bit word was split into bytes in the wrong order; swap the byte assignment in the copy.
  • EDS imported, I/O module created, words still zero — the network side is configured; none of that moves data between the two image areas.

A locally valid process image says nothing about the far end of a transfer, which is the same principle that leaves why IO-Link hub outputs stay off despite a valid process image.

Read the names PiCtory actually configured #

piTest addresses process-image variables by their configured names, so the name comes first. Open the gateway module in PiCtory and record every data variable's exact name, direction, and width. Default names follow a plain pattern such as Input_1 — one name per configured item, not a fixed interface you can guess from an application note. In this setup, the name Gateway_Output_Word_1 shown in a gateway example did not resolve: piTest reported the address as unknown because PiCtory had never been given that name. The configured names are the source of truth; an example's names are not.

Run piTest -d to list the configured devices and compare them with the intended arrangement. This setup listed the gateway at device address 31 — a slot number in the diagnostic listing that is neither a variable name nor a byte offset, so do not use it to address data. If a name still fails to resolve after PiCtory and the listing agree, only then investigate the EtherNet/IP connection itself. The same name-first workflow, configure the gate in PiCtory and confirm its variables with piTest, is walked through step by step in this PiCtory and piTest configuration guide for a RevPi gate; the steps are identical for an EtherNet/IP gate.

Prove each direction before writing the copy #

Direction names are relative to the observer. A CompactLogix input tag holds data the PLC receives, so it is fed from the gateway's outgoing area; a CompactLogix output tag arrives in the gateway's received area. Map both before writing any code.

  1. Read the source by name: piTest -r Input_Word_0 should return the value the Modbus slave currently holds. If it does, acquisition is proven.
  2. Find the PLC-to-RevPi path: force a known value into a CompactLogix output tag, then read the gateway's input-side variables by their configured names. The location that follows the forced value is the mapping for that word.
  3. Find the gateway-to-PLC path: piTest reads and writes gateway data by configured name for exactly this kind of test, so write a controlled value into the variable that feeds the CompactLogix input tag and watch the tag. A change proves that direction for that location.
  4. Write the copy only after both directions are proven. If step 3 changes nothing while the read-back is correct, the fault is in the gateway's connection layout or the PLC-side mapping, not in a missing application.

Force values only while the machine is in a state where a changed output cannot start or move anything.

Copying one Modbus TCP word into two gateway output bytes #

The inputs, all from this setup: the source is the virtual Modbus master's 16-bit unsigned word Input_Word_0, verified over SSH with piTest. The destination is the gateway's outgoing area, which for this gateway pair moves in bytes while the virtual Modbus master moves words, so two consecutive byte variables from the PiCtory configuration form the destination — take their names from PiCtory, not from an example. The test value is 4660, which you write into the Modbus slave's register yourself so the expected result is known before anything moves.

The rule: a 16-bit unsigned word equals high byte × 256 + low byte, so the copy reads the word once per cycle, computes both bytes, writes each to its gateway variable, then reads both back and reassembles them for the check.

The arithmetic: 4660 ÷ 256 = 18 with a remainder of 52, so the high byte is 18 (0x12) and the low byte is 52 (0x34). The check reassembles as 18 × 256 + 52 = 4608 + 52 = 4660.

In revpimodio2 the loop needs no offset arithmetic at all: the library manages the process-image reads and writes by name, offsets included, so the copy is one read of Input_Word_0, a split, and two writes by name.

Run the loop and the CompactLogix input tag reads 4660.

Read that result against four outcomes. If the read-back bytes are 18 and 52 and the tag matches, the copy is correct and done. If the tag shows 13330 instead, the bytes are reversed — 52 × 256 + 18 = 13330 — so swap which byte receives the high part. If the read-back is correct but the tag stays at zero, the copy is fine and the fault sits downstream in the gateway's connection layout. And if your PiCtory configuration exposes a word-width gateway variable, skip the split entirely and copy word to word.

What the offset is for, and where the copy runs #

The offset a module occupies in the process image locates that module's bytes for raw access. It is an address inside the RevPi's shared image, not a request to synchronize anything, and it is not interchangeable with the CIP data positions in the gateway's own document, which describe the EtherNet/IP side of the device. Reusing the source module's offset as the gateway destination reads a neighbour's bytes instead; the same silent-misread pattern is why CODESYS writes miss the process image offsets on a different controller family. For the first tests, stay with named access so an arithmetic slip cannot disguise the data-path problem; use raw access through /dev/piControl0 only when you need it, and take the offset, width, and direction from the active configuration.

Three hosts can run the copy, all on the RevPi itself: a Python script using revpimodio2 for named access; raw reads and writes through /dev/piControl0; or Node-RED, which works but must do the byte-to-word conversion itself because the gateway moves bytes and the Modbus master moves words. Whichever you choose, keep it running under a service or startup script: a copy loop that stops leaves the last values frozen in the gateway image, which from the PLC looks exactly like a dead connection.

The decision for each case #

  • CompactLogix words zero while Modbus values are live: the network side needs nothing — write the copy loop.
  • piTest reports an unknown variable name: take the name from PiCtory and retry; do not reuse names from an application example.
  • Both directions proven with piTest: the configuration is correct, so any remaining wrong values are copy-loop faults.
  • PLC value equals low byte × 256 + high byte: swap the byte order in the copy.
  • Read-back matches the source but the PLC never changes: the gateway-to-PLC connection or its layout is at fault — recheck the gateway's configured data layout against the PLC module definition before adding logic.
  • Word-width gateway variables exist in PiCtory: copy word to word; no split needed.

Questions asked

Does the EDS file or CompactLogix logic move the data instead?

No. The EDS file only describes the gateway to the PLC engineering software, which is what lets you create the I/O module and set up the connection. Logic in the CompactLogix can move data between tags on the PLC side, but the transfer between the Modbus master's words and the gateway's data area happens inside the RevPi process image, so only an application running on the RevPi can perform it.

Does a signed Modbus register need different copy logic?

No. Splitting a 16-bit word into a high and a low byte copies the raw bit pattern, so a register holding a negative value produces exactly the same two bytes as its unsigned reading. Only the interpretation changes, so make the CompactLogix tag 16 bits and signed when the register is signed, and keep the copy itself unchanged.

How do I keep stale Modbus data out of the PLC?

A copy loop keeps writing whatever the master's image last held, so a dead poll looks like frozen values in the PLC rather than an error. Track the poll's success inside the copy application and write a fault bit to a spare gateway byte, then let the CompactLogix logic alarm on that bit instead of trusting a value that has stopped changing.

Keep reading

  • How-to

    Read EtherNet/IP module register data with explicit messaging

    The iR-ETN remote I/O adapter exposes each analog module's error code through its Module Register CIP object: class 112, instance set to the module's slot number, attribute 16. A Studio 5000 MSG explicit message reads it in 2 bytes; the cyclic I/O connection never carries this register.

    Industrial networks

  • Explainer

    Designing a 1734-AENT Point I/O fiber ring on EtherNet/IP

    Yes — enable IGMP snooping on all seventeen switches: the input data a 1734-AENT adapter produces is multicast, so without it every switch floods the ring and all sixteen adapters reject each other's packets. Full-duplex switching ends collisions but not congestion, each fiber span must meet its own optic's distance limit, and ring recovery must beat four times the RPI.

    Industrial networks

  • Troubleshooting

    EtherNet/IP remote I/O fails on one controller, not another

    Treat the adapter as proven good and work the two controller projects instead: record the CODESYS version plus the Ethernet and EtherNet/IP scanner component versions on both, move the failing project toward the working one one difference at a time, and retest against the same adapter after each change. Only a matched software set that still fails puts controller hardware back in scope.

    Industrial networks