Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: brucek on August 07, 2020, 08:05:59 AM

Title: multiple PLC hearbeat
Post by: brucek on August 07, 2020, 08:05:59 AM
 Is there a standard for doing a heartbeat between 2 or more PLC's? I'm thinking of just doing a ST4 (1 sec) in the Primary PLC and put it in peerlink. Then have a Timer in the Secondary PLC of say 5 seconds and have that bit in the peerlink enable the timer. If the Timer Done bit is ever on then it shuts down the motion outputs in the secondary PLC.
Title: Re: multiple PLC hearbeat
Post by: franji1 on August 07, 2020, 09:05:06 AM
No standard, but you have the right idea.

You could put DST22 (current time as 1970 Epoch value, the number of seconds since Jan 1, 1970) into first 2 WORDS of a PLC's PEERLINK block (e.g. PL0/1 as PL0:SD, PL16/17 as PL16:SD, PL 32/33 as PL32:SD, etc.).

What's good about DST22 as the "heart beat", is that it is a numeric value, not a bit, so there's no chance of hitting some "resonating" flaky comm sequence where the single bit stays ON for 5 cycles (and reports a false "dead PLC").

If it's changing, you know that PLC is alive and well (i.e. in RUN mode), so if it hasn't changed for 5 seconds, you know it's not.

Use a Delta contact with inline NOT contact driving a TMR 5.000s.  If the .Done bit turns ON, that PLC has not reported a time change in 5 seconds.

STRDLT PL0:SD
NOT
TMR T0 5000

A side effect of this specific mechanism is that everyone can see the status of the Real Time Clock in all the other PLCs, if needed!

Title: Re: multiple PLC hearbeat
Post by: brucek on August 07, 2020, 09:33:01 AM
Thank you that is a great idea.