Heartbeat code

sparky64

Member
Join Date
May 2003
Location
Newcastle upon Tyne
Posts
127
HI

I'm involved in installing a DCM card in an slc5/04, it is going to be used to handshake i/o between a plc5 and the slc500.

I need to monitor the comm's between the plc5 scanner port and the slc500 DCM card, and if the comm's is lost i will bring a fault on and stop the machine.

I've heard of heartbeat and watchdog timers?? but never seen or used them....could someone give me an example or some advice.

Cheers

Sparky :cool:
 
First a little discussion of the two terms you listed; heartbeat and watchdog.
A heartbeat is simply a cyclically toggling bit. Usually the toggle period is long enough to insure that no matter how bad the communication delays get in a generally functioning application you will never miss a state change of the heartbeat. When I've used heartbeats I've usually run about a 2 second period (1 sec on, 1 sec off), but my application could handle that amount of time without communication. You need to adjust the heartbeat period basedon your application needs.
A watchdog is a timer that looks for some action or event and is reset when the action/event occurs. In the comm case you list the watchdog could be reset on a oneshot of the heartbeat on state. Usually the watchdog time is set to a couple or three event periods (heartbeat periods in the comm case) and a fault is indicated if the watchdog ever times out. Most plcs use a hardware watchdog to detect if they lock up.
I have had the most success using a combination of a handshake and a watchdog. If you have control of both plcs in your case it is pretty easy to do. Add a rung like this in one plc:


| A B |
|-------]/[--------------( )----|
| |



with A being the bit coming from the other plc and B the bit going to the other plc.

In the other plc add this:

| B A |
|------] [---------------( )----|
| |



Then monitor B in the first plc and A in the second plc with a watchdog and you will be able to tell if the comm link is lost or if the other plc is not running. Just reset your watchdog on a oneshot of the output.
The nice thing about this structure is the toggle is independent of comm time. You only need to adjust your watchdog to the longest delay you are willing to live with and let 'er run.

Hope this helps.
Keith
 
You should also check these bits in the DCM input word:
I;x/8 - DCM Fault detected
I;x/9 - PROGRAM/TEST/FAULT MODE
I;x/11 - DCM Initializing
I;x/13 - DCM Comms error

where x is the slot number of your DCM card
 

Similar Topics

Hi everyone, I have a task at work that I'm hoping someone will be able to help me find a solution for. Here is the background info: I have a...
Replies
10
Views
418
Hi everyone I've created an FC that includes the blocks TCON, TDISCON, TSEND and TRCV. This block has to be as generic as possible across...
Replies
15
Views
1,525
In studio 5000 is there an easy way to do a Heartbeat between two Control Logix PLCs? Say you have Produced and Consumed from both is there even a...
Replies
8
Views
1,222
Hi all, I have an application where there is a Control Logix PLC connecting to a B&R remote I/O station over Modbus TCP via a prosoft MNETC...
Replies
5
Views
1,912
Good Morning! I need to monitor ethernet comms, between 2 Compact Logix PLC's. I have done this before with a simple pair of timers, toggling a...
Replies
7
Views
1,605
Back
Top Bottom