Sign in to follow this  
Followers 0
Duffanator

Ethernet Heart Beat Code

9 posts in this topic

Hey all, I have a question on something I can't figure out. I know there is probably an easy way to do this but I can't get it to work correctly. I have a q-series PLC that is running with a remote SCADA program (Citect) that is gathering information, doing some statistical analysis and then writing the statistics to D registers in the PLC. I would like to display on the touch screen, that is also connected to the PLC, wether or not the Citect connection via Ethernet is still connected or the connection has been dropped. I tried having Citect cycle an M contact every 20 seconds or so and using timers in the PLC to see if the M contact was cycling but I was running into problems with it not always working. Does anyone have any ideas for this or have a different way of doing it? Thanks!

Share this post


Link to post
Share on other sites
What's the problem with the cycling M? Is it Citect or your PLC code? There's nothing wrong with the method you are describing, and in many situations it's the only possibility.

Share this post


Link to post
Share on other sites
heart bit is simple thing to do and there are different solution. probably the simplest is to let PLC do the work and let SCADA only mirror the bit (that way you can easily make changes any time such as duration of the heart-bit etc): 1. on the PLC side you create clock that has certain on/off time. 2. scada reads that bit and writes it's value to another PLC bit. 3. plc checks if that bit is stuck high for too long, or stuck low for too long. in either case set status bit "no connection". for example scada reads m0 and writes that value (0 or 1) to reply bit such as M1; no-connection status is M3. code can be modified to use only one timer for checking timeout (instead of T1 and T2) but this is simple enough and easy to follow. btw. i usually use much faster heart-bit for PCs (0.5sec or so) but this is something that will depend on number of tags etc.

Share this post


Link to post
Share on other sites
Cool, thanks for the info. That's what I was trying to accomplish but I was having a brain fart! Much appreciated!

Share this post


Link to post
Share on other sites
Wouldn't it be easier just to use the Citect cicode commands to display if your I/O device is still online? Cicode command "IODeviceInfo" Edited by Gambit

Share this post


Link to post
Share on other sites
that's not what he wanted:

Share this post


Link to post
Share on other sites
Oops !!! sorry didn't read the terminal part. I will pay more attention next time!

Share this post


Link to post
Share on other sites
it happens to me all the time

Share this post


Link to post
Share on other sites
Yeah, happens to me too I used your sample code and it worked great, I just had to write some code in the Citect program and it worked the first time (yay!) Thanks a lot, you guys are the best!

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