Jump to content

Recommended Posts

Hello,

I'm trying to figure out how to make a watchdog function in a Samba SM35-TA22-

The customer will use TCP/IP to mostly read values from the PLC.

If the communication goes down, the unit should stop. But I have no idea how to make this.

I was looking at SB147 which is Socket 0 connected but it is constantly changing when I disrupt the connection, I guess it is due to auto connect.

Is it the best option to use SB147 with perhaps a timer so if it is on for 10 seconds, that means the communication is up and the unit can run, but if sb147 change, the timer reset and the unit is stopped.

I just want some feedback if I'm all wrong here. Thanks!

//Peter

Share this post


Link to post
Share on other sites

Usually you set up a heartbeat bit.  SB 147 does not guarantee that the Master was successful.

The Master does a write and sets a bit in the PLC after it does a read.

The PLC sees this bit and notes that communication is OK.  Then it turns it off.

The heartbeat bit is also running a timer.  If the timer times out you know there hasn't been communication in a while.

Joe T.

Share this post


Link to post
Share on other sites

Peter,

 

I have implemented a fairly basic com fail detection scheme I used in serial MODBUS RTU's. As Joe T. stated this is a heartbeat the master sends to the slave (and also can be echoed back for loss detection at the master). Toggle bit each time the MODBUS master's R/W function is called, that bit is sent to slave (in write coil), branch PTC and NTC contacts (HB bit) to a TOF timer in the slave ladder. Each time the heartbeat bit changes states in slave, the timer OFF delay is kept from expiring. set TOF time base according to how many cycles you want to allow it to miss before expiring, Use an inverted contact linked to TOF.out, that can drive an MB coil that is your com failure signalling bit (which in turn can zeroize outputs or whatever you want to happen). I use SB2 branched in with PTC and NTC of heartbeat bit, this prevents the TOF from being expired at power up (depending on where the master is in the polling cycle the slave may not see an HB bit transition  at the slaves POWER UP.  Hope this helps. If it's still clear as mud I can try to dig up a redacted code example for you.

 

Hotwires

Share this post


Link to post
Share on other sites

The toggle bits  change at the end of each polling cycle and transport via serial MODBUS to toggle O9 in the slave (an MB could also be used), PTC/NTC contacts keeps TE3 alive, O9 loops back to an input on the slave the is read by the master (call it a hairpin or loopback), the same scheme is used again in the master to monitor the echo of the toggle bits. it's fairly fool proof. If the toggle bit gets stuck in either state for longer than the timers preset then a bit will go true on both the master and the slave.

MasterToggle.JPG

MasterEchoWatchdog.JPG

SlaveWatchdog.JPG

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...