IMDHMIControls LibraryShop main store

How-to

Read EtherNet/IP module register data with explicit messaging

Industrial networks Published 8 min read

Short answer

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.

On this page
  1. Why doesn't the module error code appear in the cyclic I/O data?
  2. Which CIP class, instance and attribute hold the analog module error code?
  3. How does the byte path 20 70 24 02 30 10 encode that address?
  4. How do you set up the MSG instruction in Studio 5000?
  5. What does the 2-byte reply mean and how do you verify it?
  6. Which modules on the adapter actually expose Module Registers?
  7. What should you check first when the explicit message faults?
  8. Questions asked

When an analog module on a remote I/O station faults, the adapter knows the fault code but never pushes it into the cyclic input image, so no tag in the controller's I/O tree changes. The route to the code is an EtherNet/IP explicit message: the iR-ETN documents a Module Register object at class 112, with the instance set to the analog module's slot number and attribute 16 holding that module's error code, returned as 2 bytes. On a CompactLogix that is one MSG instruction in Studio 5000, addressed to the adapter and run on demand or on a slow timer. This article decodes the byte path, sets the message up step by step, and shows how to prove the returned code against the value EasyRemoteIO displays for the same module.

Why doesn't the module error code appear in the cyclic I/O data? #

The cyclic connection carries only the adapter's process image — the input and output words you mapped in the I/O tree — while the module error codes live in a separate object the adapter serves only when a controller asks with an explicit message.

Cyclic I/O is the implicit connection: both ends exchange a fixed block of process data on a schedule, whatever the program wants that scan. Explicit messaging is the opposite — the program issues a request, the adapter answers, the transaction ends. The error register is not part of that fixed block; the adapter serves it only to a message that asks. That split is general EtherNet/IP behavior — why explicit and implicit EtherNet/IP messaging do not interwork covers what each message type can and cannot reach. The Modbus addresses EasyRemoteIO displays are that tool's view of the same underlying registers; over EtherNet/IP the adapter hands them out through CIP objects, so ignore the Modbus numbers and address the object directly.

Which CIP class, instance and attribute hold the analog module error code? #

The adapter documents the error code under its Module Register object — class 112 decimal, with the instance set to the analog module's slot number and attribute 16 holding that module's error code register, as defined in section 9.8, 'Module Register object', of the iR-ETN user manual.

CIP structures every object this way: a class is the set of objects of one kind, an instance is one object within that class, and attributes are the data items inside it, as ODVA's CIP specification lays out. On this adapter the Module Register class takes the analog module's physical slot number as the instance, so the instance in the message must be the slot where that module actually sits — the worked example below assumes the analog input module sits in slot 2, therefore instance 2. Confirm the slot in EasyRemoteIO before building anything. An explicit message names a service plus this three-part address, the same structure reading and writing Logix tags from CODESYS with CIP GenericService applies from the CODESYS side when it addresses a Logix controller.

How does the byte path 20 70 24 02 30 10 encode that address? #

Each pair is a one-byte type code followed by the value: 20 introduces the class byte, 24 the instance byte, 30 the attribute byte, and the example path 20 70 24 02 30 10 reads class 0x70, instance 2, attribute 0x10.

The type codes are CIP's standard path encoding — the first byte of each pair gives the width and role of the value that follows, 20 for a single-byte class, 24 for a single-byte instance, 30 for a single-byte attribute — the same codes DeviceNet class, instance and attribute codes for explicit messaging walks through for DeviceNet scanners. Values above 255 need the wider codes; none appear here.

Worked example, analog input module in slot 2. The class is 112 decimal: 112 = (7 x 16) + 0, so the class byte is 0x70 and the first pair is 20 70. The instance is slot 2, decimal 2 = 0x02, giving 24 02. The attribute is 16 decimal: 16 = (1 x 16) + 0, so the attribute byte is 0x10 and the third pair is 30 10. Joined, the path is 20 70 24 02 30 10. Move the module to slot 5 and only the instance pair moves, to 24 05; the class and attribute pairs stay untouched.

Path pair Type code Value carried
20 70 20, single-byte class 0x70 = 112 decimal, the Module Register class
24 02 24, single-byte instance 0x02 = slot 2, the analog module's physical slot
30 10 30, single-byte attribute 0x10 = 16 decimal, the error code register

How do you set up the MSG instruction in Studio 5000? #

Create a message tag, run a MSG instruction from a rung you trigger on demand or periodically, configure it as an EtherNet/IP explicit read of class 112, the slot's instance and attribute 16, point the destination at a 2-byte element, and set the path to the adapter's IP address.

  1. Create the message tag — the example name aiErrRead is arbitrary — of the controller's message type, initial value 0.
  2. Add a MSG instruction on a rung and condition it with a one-shot or a slow timer bit, so the adapter is polled rather than hit every scan.
  3. Set the message up as an explicit read of a single attribute: the service is Get Attribute Single, service code 0x0E.
  4. Enter the class, the slot's instance and the error-code attribute exactly as the table above decodes them.
  5. Point the destination element at aiErrCode, an INT (16 bits) initialized to 0, which matches the reply size exactly.
  6. Set the message path to the adapter's Ethernet address, for example 192.168.1.50.
  7. Run the message, watch its completion and error status bits, and read the code out of aiErrCode once the done bit sets.

The read rides the same Ethernet link as the cyclic connection and leaves it untouched — the I/O tree and the process image stay exactly as configured.

What does the 2-byte reply mean and how do you verify it? #

The reply is the analog module's error code register, returned in 2 bytes; what each code means — and what a healthy module returns — is defined in that module's register documentation, so verify the read against EasyRemoteIO before trusting it in logic.

Verify in two passes before the alarm logic goes live:

  • Healthy pass: complete the read on a known-good module. In the illustrative example, the slot-2 module returns 0 and EasyRemoteIO shows no active fault for that slot; matching values confirm the instance, attribute and size all decode correctly.
  • Fault pass: create a fault the module detects, such as a broken signal conductor, and read again. The returned code must equal the code the tool displays for the same event, with the module's register chapter as the translation table.

A message that completes but returns a value that never moves, whatever the module does, is reading the wrong instance or an unwritten buffer — not a working diagnostic. One boundary holds throughout: this register is diagnostic data, so machine protection stays on the module's own documented fault reactions and the rated devices behind them; the alarm built on this read is maintenance indication, not a safety function.

Which modules on the adapter actually expose Module Registers? #

Only iR analog modules document Module Registers — the iR-AI04-VI analog input reads through this path, while the DM16-N digital module has no Module Register object, so class 112 has no valid target on it.

The per-module detail lives in chapter 7, 'Registers', of each analog manual: the VI-series analog input manual and the TR-series analog manual each list every register, its size and the meaning of each value the error register can return. That chapter is also what turns a returned number into a diagnosis — which fault, which channel, how severe — so keep it beside the alarm logic. The DM16-N sits outside this method entirely: the adapter's own manual is the documented source for whatever diagnostics its digital points expose.

What should you check first when the explicit message faults? #

Work the fault from the message outward — path, then class, instance and attribute, then data size — before changing any alarm logic, because a rejected path and a wrong instance both end as a message error rather than bad-looking data.

  • Message errors: confirm the controller reaches the adapter's IP address, then recheck the path — class, instance, attribute, service and reply size, each against the table.
  • Wrong-slot suspicion: open EasyRemoteIO, read the module's actual slot, re-encode the instance pair — slot 3 becomes 24 03 — and rerun.
  • Completed but frozen value: retest under a real fault; if the tool shows a fault and the read does not move, the instance or the destination buffer is wrong.
  • Digital-module temptation: skip it — no register object exists there; the adapter's manual documents what digital-point diagnostics exist.

The decisions, by case: an analog module with a known slot — build the path from the table, run the healthy and fault passes, then alarm on the returned code per the module's manual. A digital module — no Module Register read exists, do not point the message at it. A message that faults — fix path, address and size before touching any alarm logic. A message that completes but never changes — wrong instance or stale buffer; recheck the slot and retest under a real fault.

Questions asked

Which manual documents the Module Register object and the error codes?

The adapter's user manual, document UM018002E, defines the Module Register object in section 9.8. Each analog module's own manual carries the register detail in chapter 7, 'Registers': document UM018013E for the VI-series analog inputs and UM018014E for the TR-series modules. Those chapters list every register, its size, and what each error code value means, which is what turns the 2-byte reply into a diagnosis.

Does this explicit read need anything added to the I/O tree?

No. An explicit message opens its own connection to the adapter, transfers the request and reply, then closes the connection and releases the resources it used. The cyclic I/O connection stays exactly as configured, the process image does not change, and no generic module entry is needed in the tree just to run the diagnostic read.

Can the same explicit message write to the error register?

The documentation for this object defines the register as a read target: the read returns the module's error code, and no write service is defined for it in that material. Treat the register as read-only — alarm on the code the message returns and clear the underlying fault at the module rather than trying to write anything back through the object.

How do you read error codes from two analog modules on one adapter?

Give each analog module its own message tag and its own instance. A module in slot 2 polls with instance 2; a second module in slot 5 polls with instance 5. Both reads keep the same class and attribute, run from staggered timer bits, and each alarm in the program references its own slot's returned code.

Keep reading

  • Troubleshooting

    Why Micro850 explicit writes fail to SMC EX600 outputs

    Your read works and the write does not because the Micro850 has no EtherNet/IP I/O scanner: its explicit Class 3 messages never supply the Class 1 output ownership the EX600 waits for, so the module holds every channel fail-safe. Set the EX600 documented output force condition, keep service 16 on class 4, instance 150, attribute 3, member 0, and build the write buffer to the documented output image.

    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

  • Selection guide

    Using a MicroLogix 1100 as a remote I/O station over EtherNet/IP

    Yes, when the station benefits from local logic and the LCD: you get 10 digital inputs, 6 digital outputs, two 10-bit voltage analog inputs and up to four expansion cards, reached over EtherNet/IP by explicit messaging one request at a time. Pick a conventional I/O adapter instead when you need cyclic implicit I/O or current inputs finer than about 19.5 µA per count.

    Controllers and I/O

Selecting an EtherNet/IP to EtherCAT gateway for drives