I am using the GSV bit to retrieve the PLC time, but it says the year is 1970. I haven't been able to find anyway to change the PLC's clock. I'm sure there is some way to do it, but I can't figure it out.
I am using the GSV bit to retrieve the PLC time, but it says the year is 1970. I haven't been able to find anyway to change the PLC's clock. I'm sure there is some way to do it, but I can't figure it out.
You can set the clock using RSLogix/Studio 5000 programming software.
Controller properties -> Date/Time tab : see first picture.
The GSV and SSV instructions to get and set the time (from the Help) suggests you use a DINT[7] array for the values. You can make your life a lot easier if you create a UDT of the "same size and shape" and use the first element as the destination of an GSV, or the source of an SSV : see second picture.
Note that the PLCs WallClock does not do DST adjustment automatically, you have to write code to enable/disable it at the appropriate dates and times if you want DST functionality. If you want help with that I already have it done - just ask.
With the recent time change I'm interested in that code to automatically toggle the DST setting in the Time/Date tab. I had to go and manually change it in all the PLCs.