inick2005i
Member
With a SLC or Micrologix, I typically put a copy of the free running clock as the first element of a message block. The PLC on the other end compares that value to a copy of it and if equal, runs a timer. If the incoming data doesn't change after so many seconds, either the communication has failed of the other PLC is not running. In Logix5K you could use a member of the WallClockTime since I don't think there's a free running clock.
We do similar at our plant.
In Allen-Bradleys we have a structured text routine that runs every 1 second.
PLC.Heartbeat:=(PLC.Heartbeat + 1);
When it becomes greater than 255, we zero it. We refer to them as "heartbeats". All of our PLC's have them. We data trend them with Historian to be able to go back and see comm issues or precisely when a PLC stopped running due to a fault, power issue, etc.
Any PLC who must communicate with another PLC will compare what they are seeing from the other PLC, if the number changes, they update the number and reset alarm TMR. When it stops updating, alarm TMR runs out (60 secs or so), and gives a comm alarm for the offending PLC. Depending on severity of what a comms issue could cause, we will let the alarm time be longer (2 or 3 minutes) in hopes the card will resolve it's hangup on its own.