Sign in to follow this  
Followers 0
Jeremiah

RSLogix 5000 Wall Clock

6 posts in this topic

I need to reset a group of RTO's at 6AM every morning. I have never used the free running clock in RSLogix 5000 and can't seem to find it anywhere. How would I go about doing so? Your help is appreciated. Thanks in advance. JS

Share this post


Link to post
Share on other sites
use a GSV (Get System Value) instruction to retrieve the wallclock time from the processor - and put the values for Year, Month, etc. into a DINT[7] array that you've created for the purpose ... once you've got the data stored in the array, then you can use EQU (Equal) and other comparison instructions to trigger different actions ...

Share this post


Link to post
Share on other sites
Controller scoped tag: Date_Time DINT[7] *Dint array where date and time is to be stored Date_Time[0] is the year Date_Time[1] is the month Date_Time[2] is the day Date_Time[3] is the hour (24 hour format) Date_Time[4] is the minute Date_Time[5] is the second Date_Time[6] is microseconds. Controller scoped tag: One_Shots Bool[64] *array for one shot status bits Controller scoped tag: Reset_All Bool *boolean used elsewhere to reset timers In Logix5K V16 or later use: GSV WALLCLOCKTIME ? LocalDateTime Date_Time[0] In Logix5K version 15.x or earlier, use GSV WALLCLOCKTIME ? DateTime Date_Time[0] EQU Date_Time[3] 6 EQU Date_Time[4] 0 ONS OneShots[63] OTE Reset_All. I recommend using a periodic task since its not necessary to execute this code continuously.

Share this post


Link to post
Share on other sites
Excellent Suggestion Alaric!!! Not everyone has looked this up but GSV and SSV instructions are real scan time hogs compared to XIC, OTE and even COP, CPS instructions. I never thought of using a periodic task for WallClock maintenance before and I think it makes great sense.

Share this post


Link to post
Share on other sites
Bob, you may be interested in something I saw two weeks ago about the continuous task at one of Rockwell's Automation On the Move events (mini Automation Fair). The class instructor opened the continuous task and monitored the program scan time which was running between 3 and 4 milliseconds for the demonstration program. In this PLC the only task was the continuous task. The continuous task time slices with all of the PLC housekeeping, communication servicing, etc. He put the PLC in program mode, switched the task to periodic at 10 msec and put it back into run mode. Now the program completed a scan in about 0.7 milliseconds. Then he changed the task period to 2 msec. So now the program was being executed nearly twice in the same time that it ran just once before. So today I had some time while waiting for Bubba and Cletus to complete some mechanical work on a startup and I did the same thing. This PLC has 8 tasks including the continuous task and all 7 periodic tasks have a higher priority than the continuous task, but I still dropped the max scan time from 3.2 mSec to 1.2 mSec. I actually changed the task back to continuous because there are a couple dozen similar machines, but it was an interesting exercise.

Share this post


Link to post
Share on other sites
Excellent approach by Ron, et. al. One additional use that we are doing is to update all PLCs on the highway, comms by the following: at say 23:50hrs (military standard), MOV the dint array to a tag base range, then MSG date/time tag base to each PLC upon change.. first to an integer array in each, then to the S files. MSG.DN triggers the next MSG send, etc. etc. We also use a day increment counter that is reset >7, so you could use that rollover to update the PLC system clocks. We are using a CTX for the master in this fashion to keep all others in "sync" for production tallies and a bunch of other calc timings.

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