Sign in to follow this  
Followers 0
S. Green

How to use the long time timer

3 posts in this topic

when doing program, sometime really need a long period timer, I used to use RTO retentive timer, that can make 69 minute time delay. but recently I got problem.

the production runs 24x5 hours, I have to keep one of my program function to monitor the equipment fault, I could not get the plc time by using GSV. the system time doesn't work. (all the other production lines, the system time work well, only this line 1769-L30ER 5330ER)

By calculation, one day is 24x3600 seconds, six day is 144x3600 second, so I use CTU to count the every second, and use the CTU.ACC as relative time record. 

If the production line runs five days with no stopping, the counter will count to 120x3600 second, it's long enough to keep the monitor on. once the line stops, reset the counter to zero. waits for next starting up.

 

 

S. Green

Share this post


Link to post
Share on other sites

I am not following your problem.  The Preset of an RTO in RSlogix 5000 Version 20 , the last supported version for 1769-L30ER is a DINT.  As a DINT it can go out to 2,147,483.647 milliseconds or 2,147,483 seconds or 35,791 minutes or 596 hours or 24 days.  This is well beyond the week you need.

Have you tried the following code for your system time - "GSV WallClockTime ? DateTime LocalDateTime[0] " with LocalDateTime as an array of 7 DINT.

Both appear to work

1 person likes this

Share this post


Link to post
Share on other sites

For accumulating timers like that, I generally use a high priority periodic task with its interval set appropriately. Put an ADD instruction behind whatever conditions you're checking for. It'll accumulate a LONG time with a DINT tag. If I want to track how long the machine was in different modes, I just put an XIC with the bit for that mode in front of the ADD instruction. You can log the time or do whatever you need to with it at the end of the day.

If the same code in other PLCs works to get the system time but not this one...but this one works fine otherwise...I'm not sure what to say. What PLCs do the other machines have? When you go online with the processor and go to the Date/Time tab of the Controller Properties, are the date and time correct? What goes wrong when you try the GSV instruction? Do you just get bad data back or does the instruction fail?

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