emo

How can I measure time delays on the network with a PLC code

8 posts in this topic

Hi everyone,

I would like to create a PLC code using RSlogix 5000 program in order to measure time delays on the network. Can anyone help me to do this?

Thanks.

Share this post


Link to post
Share on other sites

Transfer the clock seconds, or minute if the delay is long, to a tag and read it in SCADA. If it's really fast then MOV microseconds to the tag.

Do something like if Clock.Seconds = 59 MOV Clock.Seconds to Tag. Read the tag in SCADA. Not the read time. The SCADA and PLC clock would have to be synch'd.

or 

If Microseconds = 500 then move Microseconds to a tag. Compare the tag in the PLC with the tag

Somewhere on this forum section I think I posted the code to create a sine wave but all that will really do for you is show how much your network delay distorts the sine wave. Ours creates a ragged square wave. 

There is bound to be a better way. Maybe it's something as simple as opening two windows and watching the Clock.Seconds value and the Clock.Seconds tag in two separate windows. 

The PLC clock can be read to a tag with a GSV (Get System Variable) command. I use structured text. Ladder works too. The help file isn't too bad. You'll need a user defined data type wit the correct structure to write to. I made my tagname = Clock (which is why I referenced Clock.Seconds

Share this post


Link to post
Share on other sites

Thank you Michael Lloyd,  

Actually, I would like to measure the time delay between PLC and PowerFlex Drive,  here SCADA is not involved. So do you have another advice? And also could you please share the link or code of the delayed sine wave.

Share this post


Link to post
Share on other sites

I use ControlLogix PLC and PowerFlex Drive which are connected with TCP/IP network. However, I don't want to use network monitoring tools in order to measure the delay, I want to measure delay with a PLC code. 

Share this post


Link to post
Share on other sites

Have you tried to use WireShark and study to interpret packet transfer?  Turn off all ports and communication connections on your WireShark PC except for the port connected to the PLC/Drive network, setup WireShark to monitor, let it run for time, stop and save the file, then go back through.  After awhile you will get a feel for the PLC/Drive connections in the WireShark report.

If you can procure a spare PLC with a network connection, you can code on both ends reading and writing of time/date with heartbeat tags.

 

Share this post


Link to post
Share on other sites

I have used the trending facilty in Logix 5000 to monitor network delays. Basically, trend an input that provokes an output together with the output (or expected result of the output).

I have found the delays to be typically 600 msec. whether DNet, Ethernet/IP, or Profibus.

 

Edited by Gerry

Share this post


Link to post
Share on other sites
On ‎10‎/‎14‎/‎2016 at 5:25 PM, emo said:

Thank you Michael Lloyd,  

Actually, I would like to measure the time delay between PLC and PowerFlex Drive,  here SCADA is not involved. So do you have another advice? And also could you please share the link or code of the delayed sine wave.

The sine wave routine is here: http://forums.mrplc.com/index.php?/topic/31212-sine-wave-generator/

I don't think it's very useful but you asked

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