marcinmrag

Cx- Programer Elapsed time

5 posts in this topic

Hello!

I would like to measure cycle time but i don't have any idea how i can do it in cx-programer. All timers dosn't have feedback information about elapsed time. Can someone help me how i can handle this problem?
 

Share this post


Link to post
Share on other sites

What is the model number of the plc you are using?

Share this post


Link to post
Share on other sites

What is the accuracy you are looking to achieve?
Depending on the PLC you can handle this a couple of ways. 1 - set the scan time and then count the number of scans. 2 - add the scan time every cycle 

Regards,
Garry

Share this post


Link to post
Share on other sites

Here is a very simple way to do this:

5caf3fcebf378_CycleTimer.jpg.8938c65c16c

Use a clock pulse bit to increment the value in a register (D0 in this example) when a certain condition is true (W0.00).  When the condition turns off, then move the value from D0 to D1 and set D0 back to 0.  The value in D1 will be the cycle time in seconds (in this example).  If 1s is not a fine enough resolution, there are shorter clock pulse bits:

5caf406383265_ClockPulsebits.jpg.1245150

 

I don't show it here, but if you are using the D area for the registers, make sure to do a MOV &0 into D0 on the first scan as well to reset the current timer value to 0 at power up of the machine.  If you need to be in the ms range and need it to be very accurate, the previous post is a good suggestion.

Share this post


Link to post
Share on other sites
18 hours ago, Michael Walsh said:

Here is a very simple way to do this:

5caf3fcebf378_CycleTimer.jpg.8938c65c16c

Use a clock pulse bit to increment the value in a register (D0 in this example) when a certain condition is true (W0.00).  When the condition turns off, then move the value from D0 to D1 and set D0 back to 0.  The value in D1 will be the cycle time in seconds (in this example).  If 1s is not a fine enough resolution, there are shorter clock pulse bits:

5caf406383265_ClockPulsebits.jpg.1245150

 

I don't show it here, but if you are using the D area for the registers, make sure to do a MOV &0 into D0 on the first scan as well to reset the current timer value to 0 at power up of the machine.  If you need to be in the ms range and need it to be very accurate, the previous post is a good suggestion.

thx I did this yesterday in similar way :). In sysmac studio or tia portal is much easer to do it.

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