An EtherNet/IP Connection That Drops Once a Day and Logs Nothing: Where to Start

An EtherNet/IP Connection That Drops Once a Day and Logs Nothing: Where to Start

The line stops somewhere between 05:00 and 06:00, four mornings out of five, and by the time anybody reaches the panel the 5069-AENTR is steady green, the Connection tab of Module Properties is clean, and a GSV of the module’s FaultCode returns 0. Nothing in the controller disagrees with the idea that the fault never happened.

It happened. The reason there is nothing left to read is printed in the manual: the Module object’s FaultCode and FaultInfo attributes are valid until the fault condition is corrected, and a connection that re-established itself corrected the condition. So the first job here is not diagnosis. It is fourteen lines of Structured Text that catch the next one with a timestamp on it, because everything past this point needs to know what time it happened and which modules went together.

Why there is nothing to read in the morning

An I/O connection is a UDP conversation with a timer on it, and when the timer runs out the controller tears the connection down, posts a fault, and immediately starts trying to open it again. If the cause lasted two seconds, the connection is back inside a few seconds and the fault attributes go with it.

The module fault text on the Connection tab is a live read, not a log entry.

That single design decision is why this fault has a reputation. Everything the controller knows about the drop is true only while the drop is happening, which on a once-a-day fault is a window of roughly four seconds in twenty-four hours, and nobody is watching. Studio 5000 formats the message as I/O Fault ModuleName #XXXX message while the connection is down and that whole string is gone afterwards. The other reason people conclude there is no evidence is that they look in the controller’s own fault records, which cover major and minor faults, and an I/O connection that dropped and recovered is neither of those unless somebody ticked Major Fault On Controller If Connection Fails While in Run Mode on the module’s Connection tab. Almost nobody ticks it, and on a running line it is usually the wrong thing to tick anyway. Reading a CompactLogix fault in the four places the controller says what broke covers those records; this fault will not be in them.

One cell drawn as it is cabled: a 1756-L83E, a 1756-EN2T, an access switch and two devices behind it, each with its address and RPI, with the note that modules faulting together points upstream of all of them

Draw this before you read a single counter. The question “which of them faulted in the same second” is answered by the drawing, and it is worth more than any diagnostic page on the module.

The fourteen lines that make the next one countable

Put a one-second periodic task in the project with one block of this per module you care about, and leave it there permanently.

Advertisement

The three attributes that matter come off the Module object with GSV, and the object name is the module’s name in the I/O tree exactly as it appears there. EntryStatus gives the state machine, FaultCode gives the reason, and FaultInfo gives a further DINT that is usually zero and occasionally the only thing that separates two identical-looking faults. Latch on the falling edge of Running, copy WALLCLOCKTIME into the record at the same instant, and increment two counters — one for drops, one for recoveries. Those two counters answer a question you will be asked within a day: is this the same fault repeating, or is something not coming back at all? Equal counters mean every drop healed. A drops counter one ahead of the recoveries counter means you are looking at a module that is down right now. Size the array at 64 records and wrap it; a fault that fills 64 records in a shift is not the fault described in this article and the array will tell you that too.

Sixty-four records is about two months of one-a-day.

The same shape of instrumentation, applied to analogue values rather than module states, is in catching a PLC intermittent fault with a trend in the controller, and the argument is identical: the controller is the only thing that is present when the fault is.

The Structured Text that reads EntryStatus, FaultCode and FaultInfo with GSV, tests the masked EntryStatus against 16#4000, and latches a wall-clock timestamp plus the code into a wrapping 64-record array, with the record layout and one night's counters shown underneath

The Downs and Ups counters being equal is the useful part: every drop in this array healed itself, which is what makes it a timing or a path problem rather than a dead device.

Reading EntryStatus the way the manual tells you to

There is a trap in EntryStatus and the general instructions reference is unusually direct about it.

Only bits 12 to 15 carry the state, so mask the low twelve bits before comparing. The states are 16#0000 standby, 16#1000 faulted, 16#2000 validating, 16#3000 connecting, 16#4000 running, 16#5000 shutting down, 16#6000 inhibited, 16#7000 waiting on a parent, 16#9000 firmware updating and 16#A000 configuring. The trap is that testing for 16#1000 to decide whether a module has failed does not work, and the manual says why: the Module object leaves the Faulted state periodically while it is trying to reconnect. A watchdog written that way samples the module during a reconnection attempt, reads 16#3000, concludes “not faulted”, and misses the event entirely. Test for Running instead, and check FaultCode separately for the reason.

Mask the low twelve bits, compare against 16#4000, and stop there.

A comparison of watching EntryStatus for 16#1000 against watching for 16#4000, row by row: the retry case, the inhibited case and the waiting-on-parent case all read as not-faulted under the first test and correctly under the second

Three of the five rows are cases where “not 16#1000” is true and the module is not running. That is the whole argument for the 16#4000 test.

If the module type gives you a ConnectionFaulted bit in its input tag, use that as well — on a Compact 5000 digital module it is documented as 0 when the connection is running — but the GSV works on every module in the tree, including ones whose input tags you did not map.

How quiet the wire has to go before the connection drops

Worth knowing before you start theorising about what a four-second interruption could be, because the number is smaller than most people assume.

Advertisement

An implicit connection times out in the controller’s multiplier multiplied by the RPI, the firmware picks the multiplier, and the rule is that the product must reach at least 100 ms with a minimum multiplier of 4. The manual prints two worked examples: an RPI of 2 ms gets a multiplier of 64 and times out at 128 ms, and an RPI of 10 ms gets 16 and times out at 160 ms. Follow the same rule down and a 20 ms RPI lands on a multiplier of 8 and a 160 ms timeout, while a 50 ms RPI keeps the minimum multiplier of 4 and times out at 200 ms. So the interruption that dropped your connection was probably not four seconds long. It was more likely 200 milliseconds, and the four seconds you saw was the recovery.

That changes the list of suspects. A 200 ms gap is a spanning-tree reconvergence, a port flapping, a burst that filled a queue, or a device rebooting — not somebody knocking a cable.

A table of RPI against the multiplier the firmware selects and the resulting connection timeout, with the two published examples marked and the derived rows for 20, 50 and 100 ms RPI

Two of these rows are printed in the manual and the rest follow its rule. If you have been told to raise the RPI to make the fault go away, this is the table that shows what you are actually buying.

What everybody swaps first

The drop cable. Then the module. Then, if there is a spare, the switch.

It is almost never any of them. An intermittent that arrives at the same time of day is a scheduled event somewhere, and cables and silicon do not keep a calendar. A cable fault that is genuinely a cable fault shows up as errors that accumulate with vibration or temperature, not as one clean drop at 05:40 every morning, and it usually takes one module down rather than several. Swapping parts on a once-a-day fault also destroys your own evidence, because the counters restart and you have to wait another day to learn nothing new. The second reflex is worse than the first: raising the RPI, or reaching for the connection timeout multiplier on the bridging module. That does not fix anything, it widens the window until the fault stops being reported, and the connection timeout multiplier on a 1756-EN2T is explicit about what it hides when you do.

Leave the hardware alone until the timestamps exist.

Which modules went together, and what that rules out

This is the check that eliminates the most, and it costs nothing once the logging is in.

If the adapter and the drive behind the same switch both record a drop in the same second, the cause is upstream of both of them — the switch, its uplink, its power, or something sending traffic that the switch could not keep up with. If only one of the five modules on that switch drops, the cause is that module, its drop cable or its port, and the other four have just proved the uplink was fine. If modules on two different switches drop together, you are looking at the uplink path they share or at the controller end. A single drawing of the cell with the addresses on it turns this into a two-minute question instead of a debate, which is why the first figure in this article is a topology and not a screen. One qualification: multicast connections and unicast connections do not fail in quite the same pattern, because a multicast group being pruned by a switch takes out every listener at once while a unicast connection is point to point. If the cell is mixed, note which is which before drawing conclusions — unicast or multicast on an EtherNet/IP I/O connection sets out what the checkbox decides.

Two modules, same second, same switch. Stop looking at modules.

The time of day is the best clue you will get

Once three or four timestamps exist, compare them against everything else in the plant that runs to a clock.

Backups, a scheduled report, an antivirus sweep on the SCADA server, a UPS self-test, a shift changeover that starts a compressor, an image push to HMIs, a weekly reboot that somebody set to daily by mistake. These are not exotic and they are frequently the answer, because they are the only things in a factory that happen at the same time every day. If the timestamps cluster inside a minute, look for something scheduled. If they scatter across a two-hour window but always in the same shift, look for something a person does. If they scatter completely and only the count is stable, the cause is more likely load-related than scheduled, and that is when a capture is worth the effort — port mirroring on a Stratix switch to catch an I/O drop is the next tool, and it is far easier to aim once you know within a minute when to arm it.

Three timestamps inside the same minute is not a coincidence, and it is enough to go asking with.

Advertisement

What to do next

Add the periodic task and the GSV block for every module on the segment, not only the one that faults, and download it today. Tomorrow you will have a timestamp, a fault code and a list of which modules went together, and the three of them between them will have eliminated most of what you would otherwise have spent a week on. If the code that comes back is 16#0203, the connection timed out and the question is where the 200 ms went. If it is anything in the 16#01xx band, the connection was refused rather than lost, which is a different article and a different set of causes, and the number in it names the field to open.