PLC Time Tags

mannk

Member
Join Date
Jun 2017
Location
Texas
Posts
3
Hi, this is my first post and I'm new to PLC programming. I haven't had any training and I don't even know if this is a valid question: Are there predefined tags within the PLC, which keep actual time that I can find somewhere, or will these tags need to be created? I'm working with a CompactLogix L32E. I'm looking at controller tags right now and don't see any relating to time...just timers. If these need to be created...maybe some tips? Any help is appreciated, thanks!
 
Welcome to the PLCTalk community !

There's a system clock object that counts off microseconds, and there's also a "Wall Clock" object that stores the year/month/day/hour/minute/second in individual DINT elements.

After v16 or so, there is also a "Local WallClock" that is adjustable for Daylight Saving Time.

You have to use Get System Variable (GSV) instructions to grab this data from the controller's operating system objects and put it into tags of your choice.

Look up the GSV instruction, and the WallClock object, and you'll see how to do that to get the year/month/day information.

In addition to the Help file and the General Instruction Set Reference Manual, there's a programmer's supplementary manual for system status objects:

http://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm015_-en-p.pdf
 
Thanks! I'll take a look into it!

While you are looking at it, please bear in mind that Daylight Savings Adjustment is not, repeat not, automatically applied by the RTC module, or the processor.

Logix5000 controllers are sold all over the world, and there are various ways in which daylight saving time is implemented, this Wiki article is an eye-opener !

To use the Daylight Savings Time correctly, you have to put program code in the controller to turn on and off the "Apply DST" (SINT) at the correct dates and times.

You must also set the number of minutes to apply in "DSTAdjustment" (INT) - this is added to the "DataTime" object to create the "LocalDateTime" object.

You use SSV to set these attributes/objects.

Using the controller's DST adjustment is much easier than "rolling your own"... You don't have to worry about triggering it twice when you "put the clocks back". Here in the UK we "Spring forward, Fall back", by 60 minutes.

So in the fall (last Sunday in October) we turn off the "ApplyDST" (zero value) at 0100 hrs UTC, so that will be 0200 hrs BST becoming 0100 hrs.... then an hour later the GSV will simply "turn it off again" (by detecting 0200 hrs again), which will have no effect. One extra GSV each year isn't going to have much of an effect, and there's no need to trap it happening, unless you are totally OCD !

That Wiki article is a good read, see if you can spot the obvious anomolies to what most people call a "standard"....
 

Similar Topics

Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
85
Good day colleagues, I have a problem with a plc slc 5 since I export the tags to my factory program to load them into a panel view 1000 plus 6...
Replies
0
Views
103
I've got a whole bunch of L8's and a whole bunch of UDTs that use custom string lengths, but can't seem to figure out how to get these to...
Replies
4
Views
515
Okay, something I have not seen before.. RSView SE. I am working on an existing project. There is a value the customer wants trended and it is...
Replies
4
Views
781
I've got a bunch of tags in my code & there's a column called "Retain" (by default they were all un-ticked) - see pic. "LaserN mm" is a distance...
Replies
10
Views
1,551
Back
Top Bottom