CIP message instruction monitoring

Dale87

Lifetime Supporting Member
Join Date
Feb 2022
Location
Illinois
Posts
60
What's the easiest way to monitor a CIP data table read or write instruction. I'm reading and writing from a Compact logix to a micro 820, over UHF radios. And need to monitor the connection on both devices, I have to do various things at both ends up on comms failure. I don't have any messages instructions set up in the micro as I'm just reading and writing to it. So I'd like to use my write instruction from the compact for it's connection monitoring. I've seen it done with writing a bit to the micro then using various latch and unlatches but didn't know if this was the way everyone else did it
 
What's the easiest way to monitor a CIP data table read or write instruction. I'm reading and writing from a Compact logix to a micro 820, over UHF radios. And need to monitor the connection on both devices, I have to do various things at both ends up on comms failure. I don't have any messages instructions set up in the micro as I'm just reading and writing to it. So I'd like to use my write instruction from the compact for it's connection monitoring. I've seen it done with writing a bit to the micro then using various latch and unlatches but didn't know if this was the way everyone else did it

The way I do it (with Micrologix, SLC500, etc communicating with a Controllogix) ... the ControlLogix does a write followed by a read (with a small delay).

The controllogix increments a heartbeat register every second and that is part of the data written to the micro 820. The micro 820 would take that register and move it to the registers that the ControlLogix is reading

The controlLogix sees the readback and knows that the micro820 is running. The micro 820 knows that there is good communication if the register is changing.

The CIP communication has timeouts, done bits, enabled waiting flags .. but the timeout can be a lot longer than the time you need to react.

I've got about 40 micrologix on various communications, from ethernet/ip to serial to point-to-point blackblox modems (I don't remember the frequency) using this method. Several of the micrologix programs are identical except for the IP address so this method works pretty well.

Communications between ControlLogix (using CIP messaging) works OK this way as well. For ControlLogix, each side reads instead of one side being the master. Why the change? It is confusing to have a ControlLogix in program mode and have data table changing due to a write from somewhere else ;)
 
I use something similar to thingstodo. I make a heartbeat register part of the block of data and it is simply a constantly changing number. In the SLC/Micrologix it's a copy of the free running clock. Just MOV S:4 to one of the members of the outgoing data block. In a Click, I use SD9 (scan counter). In Logix5K I just ADD 1 to the number every scan. I've no experience with the Micro8x, but there's probably a built in number and if not, just pick an element in your block and increment it.

In the receiving PLC, I compare that heartbeat value with a copy of it and tie that to a timer set for the time needed to take action on comms loss. on a branch on that same rung, I will MOV that incoming address to the reference location used in the EQU.

If the number stops changing, it means either that comms are lost or the remote PLC stopped running. A faulted PLC will still respond to messages but won't keep copying the clock or updating its scan counter. This covers both situations without distinguishing between the two. On my systems either situation requires the same action, so I just call it comm loss, set the appropriate alarm.

On radio networks I also like to record the "data age" in seconds of each node. To do that, I will set the comm loss timer for each node to the maximum and use a GEQ on the accumulator for the alarm bit so the timer can keep counting the seconds and will reset when that heartbeat changes. The timer accumulator is now also useful as "data age".

I also like to count errors and for that, I use the rising edge of MSG.ER bit for each message to each node. I typically only have one counter for each node, so all the message error bits for that node increment the same "error count".

I give the HMI a button to clear the errors and display the counts along with the "data age".

With radio networks, I usually set the MSG timeout value to 3 or four seconds, sometimes a bit longer if there are repeaters. TO do that in a Compactlogix or Controllogix, you have to write the value in microseconds (going from memory or it might be milliseconds) to the UnconnectedTimeout element of the message. <- I might not have that element name exactly right. In a Micrologix it is the MTO element in seconds. In a SLC I use the Help file to look up the element number for timeout.

If you don't adjust that timeout value, it will default to some stupidly long number like 30 seconds which ain't gonna ever work for me. Some people write their own timeouts in ladder logic with timers that set the TO element to force the MSG to timeout early, but that can get hairy with 18 nodes and multiple messages to each.

In the slave node, comment all the addresses that are "From Main" or "To Main" so that future readers will know they are reserved even if they are spares not in use.
 
Last edited:
I use something similar to thingstodo. I make a heartbeat register part of the block of data and it is simply a constantly changing number. In the SLC/Micrologix it's a copy of the free running clock. Just MOV S:4 to one of the members of the outgoing data block. In a Click, I use SD9 (scan counter). In Logix5K I just ADD 1 to the number every scan. I've no experience with the Micro8x, but there's probably a built in number and if not, just pick an element in your block and increment it.

In the receiving PLC, I compare that heartbeat value with a copy of it and tie that to a timer set for the time needed to take action on comms loss. on a branch on that same rung, I will MOV that incoming address to the reference location used in the EQU.

If the number stops changing, it means either that comms are lost or the remote PLC stopped running. A faulted PLC will still respond to messages but won't keep copying the clock or updating its scan counter. This covers both situations without distinguishing between the two. On my systems either situation requires the same action, so I just call it comm loss, set the appropriate alarm.

On radio networks I also like to record the "data age" in seconds of each node. To do that, I will set the comm loss timer for each node to the maximum and use a GEQ on the accumulator for the alarm bit so the timer can keep counting the seconds and will reset when that heartbeat changes. The timer accumulator is now also useful as "data age".

I also like to count errors and for that, I use the rising edge of MSG.ER bit for each message to each node. I typically only have one counter for each node, so all the message error bits for that node increment the same "error count".

I give the HMI a button to clear the errors and display the counts along with the "data age".

With radio networks, I usually set the MSG timeout value to 3 or four seconds, sometimes a bit longer if there are repeaters. TO do that in a Compactlogix or Controllogix, you have to write the value in microseconds (going from memory or it might be milliseconds) to the UnconnectedTimeout element of the message. <- I might not have that element name exactly right. In a Micrologix it is the MTO element in seconds. In a SLC I use the Help file to look up the element number for timeout.

If you don't adjust that timeout value, it will default to some stupidly long number like 30 seconds which ain't gonna ever work for me. Some people write their own timeouts in ladder logic with timers that set the TO element to force the MSG to timeout early, but that can get hairy with 18 nodes and multiple messages to each.

In the slave node, comment all the addresses that are "From Main" or "To Main" so that future readers will know they are reserved even if they are spares not in use.


Ill just build a free running clock and use EQU. I like to visually see the numbers change rather than just a bit set. Good call on the MSG 30 second timeout though. Who's your go to for radio networks? We use Esteem.
 

Similar Topics

Wizards, It has been a few, but you all have always done me well. I have acquired a 1769-L33ER and want to use it as my collection PLC to...
Replies
5
Views
465
Hello forum! Long time user, first time poster. I am currently designing a control system that has a Production system, linked to live plant...
Replies
0
Views
155
Hello, PLCS.net guys. I'm learning about MSG for TCP communication recently. I'm trying to use CIP Generic. And the main flow is like the one...
Replies
6
Views
1,145
MicroLogix 1400 Using Messages to talk to PowerFlex 40P 22E-Comm Card. I have it working and when I download an updated Program (nothing in the...
Replies
9
Views
2,350
I would like to Read the CPU Usage % information like the Task Monitor tool provides from one ControlLogix to another via a CIP Message. Comms...
Replies
12
Views
5,776
Back
Top Bottom