Get date/time on Compactlogix?

dginbuffalo

Member
Join Date
Dec 2010
Location
Buffalo,NY
Posts
630
i need to log some trip data with a AB Compactlogix, and one of the items would be date and time. Do i use a GSV instruction for this? I'm used to the old PLC-5 and system registers. How do i go about get a one shot of this info? Thanks.
 
Use the GSV and read the WALLCLOCKTIME class. Read the DateTime attribute. Use the SSV to set the PLC time.

Good luck,

(8{)} :) .)
(Yosi)
 
First, make a DINT array of 7 registers, Define a tag like, PLC_TIME as a DINT[7].

Then use: GSV WALLCLOCKTIME ? LocalDateTime PLC_TIME[0]

The ? can be left blank in the actual instruction. The parameter "LocalDateTime" can be several things, as shown, LocalDateTime retrieves the local time, with time zone and DST offsets applied. Other options are "DateTime" which returns GMT time, "CurrentValue", which returns microseconds from 0000 Jan 1, 1970 in UTC to a Long integer value, and a few more depending on the revision of the firmware.

Then you get back (For LocalDateTime or DateTime):
PLC_TIME[0] - Year (4 digit)
PLC_TIME[1] - Month
PLC_TIME[2] - Day of Month
PLC_TIME[3] - Hours
PLC_TIME[4] - Minutes
PLC_TIME[5] - Seconds
PLC_TIME[6] - Microseconds


Rather then query the RTC every scan, I normally either get my system time in a periodic task, or triggered off of a 100 to 500ms timer.
 

Similar Topics

am having some issues with updating the firmware on a 1769-L35E,. The flash process will start and all the blocks are transferred, but at the end...
Replies
5
Views
1,037
Hello All, I am having a problem on my controller with Date/Time where these values seems to float away from the actual Date/Time. Is there any...
Replies
9
Views
4,351
I shipped out a 1769-L36ERM system a while back and need to update the software. I've been looking to see if this is possible with the SD card...
Replies
17
Views
9,858
I am using GSV for Wall Clock and created a controller tag to get the Date and time values. When power is removed from the processor I loose the...
Replies
4
Views
2,162
Hello Allen Bradley Experts. I have questions about updating the firmware for a CompactLogix 1769-L23E-QB1 Controller with Firmware version 18 to...
Replies
2
Views
5,129
Back
Top Bottom