Sign in to follow this  
Followers 0
Kah Chun

ControlLogix Time and Date

27 posts in this topic

Hi everyone, I know that the time and date on PLC5 and SLC500 are accessible on the status files and I can use them in the logic say for example, reset a counter at 9pm everyday etc etc. Where can I find the date and time for ControlLogix?

Share this post


Link to post
Share on other sites
Hi everyone, I've managed to solve the problem using the GSV command. I've created a user-defined tag called CLX_DateTime INIT[7] and I'm now able to retrieve the date and time information from CLX. However, this data is only updated once. Do I need to make the rung goes false-to-true to get it updated? I don't know whether I've stuffed up the PLC

Share this post


Link to post
Share on other sites
Use GSV Inst class Name wallclocktime attribute name date time dest : 7 Dint in array 1 st---year 2nd---month 3rd---day 4th---hour 5th---minute 6th---second 7th---millisecond

Share this post


Link to post
Share on other sites
Yeah, I've already created a user-defined tag with 7 DINT in array. I used it as the destination location. For the first scan, I'm able to retrieve the date and time. But it hasn't update itself since...

Share this post


Link to post
Share on other sites
place the Gsv unconditional in continous task

Share this post


Link to post
Share on other sites
not to disagree, but the GSV is a resource hog. Especially the get time one. Unless you need the time from the wallclock every scan, I'd create a timer and trigger the GSV from the timer done bit. A timer interval of 15 minutes unless the value returned is between and 8 and 9 pm and then use an interval of 1 minute shold give you your 9pm reset and not muck up your scan time.

Share this post


Link to post
Share on other sites
I guess you have placed xic S:FS before the GSV INSt? Remove Xic S:FS

Share this post


Link to post
Share on other sites
I'm working on setting up clock updates. I've read somewhere that the clocks on the PanelViews are more accurate. What if I send the updated time to the PV on S:FS and read it from the PV?

Share this post


Link to post
Share on other sites
GSVs are time hogs but I admit I also place this one in an unconditional rung. Typically about 5 GSVs total. Yes it slows it down but not enough to write home about

Share this post


Link to post
Share on other sites
I don't see any reason to execute GSV every scan in most of cases, particulary in this situation where accuracy is irrelevant. Most of GSV/SSV instructions have scan time influence, at least put them into periodic task.

Share this post


Link to post
Share on other sites
SIDE NOTE - The scan time influence of a GSV becomes a critical factor in redundant processor applications. This I know from first hand experience.

Share this post


Link to post
Share on other sites
Didn't say it was a good idea. I just really never came up with a good way to occasionally execute the GSV and keep decent track of time without a mess of timer to keep the "clock" rolling until the next update Any sample code or suggestions?

Share this post


Link to post
Share on other sites
I think conn has the best suggestion use the periodic task. Increment the seconds register each period and after X periods run the GSV. Periodic task eliminates the need for timers.

Share this post


Link to post
Share on other sites
It depends upon processor type 1756-L61,62,63 executes in 10 microseconds

Share this post


Link to post
Share on other sites
So your saying pretty much have an unconditional task containing the GSV that will execute every seconds

Share this post


Link to post
Share on other sites
May be not every second for 15 seconds once with less prority

Share this post


Link to post
Share on other sites
Clock_Routine.zip Try This Approach TW.

Share this post


Link to post
Share on other sites
For this need not be in periodic task it can be in continous task

Share this post


Link to post
Share on other sites
If you are referring to my program - yes it does need to be in the periodic task. Otherwise you do not have an accurate 1 second interval with which to increment.

Share this post


Link to post
Share on other sites
Yes, You sample would work for most applications. Just give me time and I will eventually buy into it

Share this post


Link to post
Share on other sites
Sample code probably needs a call of the gsv when the hours rioll to zero as well.

Share this post


Link to post
Share on other sites
I just have a hard time seeing adding all the code and the additional task to replace the continuous GSV. I guess it is all in your applications. With mine it has never mattered, but I'm going to tweak the sample and come up with something to suit me and eliminate the continuous GSV. I'll keep you posted Thanks TW

Share this post


Link to post
Share on other sites
same function you are doing in the logic itself so No matter with periodic task it can be in continous task

Share this post


Link to post
Share on other sites
If this logic is moved to a continuous task then the variable System_Seconds will be incremented every scan unless you make some changes to the logic, such as adding a timer and only incrementing System_Seconds when the timer is done. Since a timer would be less accurate than a periodic task I wrote the code in a periodic task. Yes you can move it to a continuous task, but not without modification. I've also updated the example to tolerate the midnight roll over. Clock_Routine2.zip

Share this post


Link to post
Share on other sites
If your doing in periodic task of 1 sec then no need for that update logic GSV can be as unconditional in the periodic tast Edited by rpraveenkum

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