Sign in to follow this  
Followers 0
PortenoSuenos

ML1400 Heartbeat

8 posts in this topic

Using two ML1400 to send data from one to another. (PLC A to PLC B) Just curious what would be the best way to use a "heartbeat" from PLC A to PLC B so PLC B knows that PLC A is OK...?? Thanks Mark

Share this post


Link to post
Share on other sites
My usual method would be to put a "heartbeat" register into the array that PLC A sends to PLC B. Then PLC A will simply increment the register once each scan (an ADD instruction tied directly to the power rail). PLC B will monitor the register and move it into a "heartbeat_OLD" register once each scan. If "heartbeat" and "heartbeat_OLD" ever equal each other, I'll run a timer, usually around 5 seconds to avoid nuisance trips. If the timer completes, then there is a problem with communications. Assuming that you are passing data back and forth, do the same thing from both ends.

Share this post


Link to post
Share on other sites
My current method is almost the same as Jeremy's except i use the internal free running clock in PLC A My old method is put bit high in PLC A then in PLC B turn it off when on and start a timer this works fine for proving communications but doesn't prove that PLC A is healthy.

Share this post


Link to post
Share on other sites
Hi Jeremy... So could I just use a 10 Sec TON in PLC B to monitor a bit from PLC A that is alternating at a 5 sec ON/OFF time, then if the TON in PLC B times out I would know it wasn't communicating..??? AND also....I would need another 5 second TON in PLC B monitoring the opposite state of the bit then IF either timer timed out I would know that the comms is lost. I think this is kind of what you are saying (I think). Sometimes Its hard for me to picture in my mind how something simple works..!! :) I found that using just the one timer did not work...hehe Mille Grazie Jeremy

Share this post


Link to post
Share on other sites
Jeremy, JNControls.. Im pretty happy with the solution to the loss of communications. So what would be the best way to transmit the "Health" of PLC A to PLC B..?? Thanks, Mark

Share this post


Link to post
Share on other sites
Depends on what you mean by healthy. If you mean not faulted, then there's really no way to tell the difference from a comm fault. If comms are down, then you won't see the heartbeat change. If the PLC is faulted, then the heartbeat won't change. Same end result. If you want to monitor other information, such as battery fault, etc., then just include that information in the message.

Share this post


Link to post
Share on other sites
I generally just use one bit as a heartbeat, and flash it on/off every 250ms or so. Then at the other end, if the heartbit bit stays the same for 5 seconds or so, I've either lost connection to the other PLC, or it's stopped executing code (faulted/program mode/etc). Just my preference, but I think it's simpler than using whole integers. The only thing you have to be aware of is the frequency of your flash, and the frequency of the communications between PLC's. I set one up once where the heartbeat would change state every 500ms, and the communications were updated every second. So despite the fact that my heartbeat was changing all the time, every time the remote PLC polled it, it was in the same state. I changed the heartbeat to switch every 750ms and the problem went away :)

Share this post


Link to post
Share on other sites
I guess that's what I see as the advantage of the integer. It takes a long time to rollover, so it will always have a different value no matter what the update rate is. With a single bit you could potentially get into a situation where you don't see the bit changing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0