Hello everyone, I was wondering i need to use some system time in my program but I dont see anywhere where i can read the controller time I set in the properties window. Anyone have any ideas
thanks for your time
The answer to this type of question is not only brand specific, it is usually model specific as well. A good answer will depend on your providing this info. However, for many models the time is in S:40, S:41, and S:42.
In the Logix-family controllers, a lot of the things that were formerly in the "S" Status file in SLC/PLC are accessed using "Get System Variable" (GSV) instructions.
The WallClockTime object is a good example. You execute a GSV instruction and make the target an array of seven DINT values:
DateTime DINT[7] The Date and Time in human readable format as follows:
This: Contains the:
DINT[0] year
DINT[1] integer representation of the month (1 - 12)
DINT[2] integer representation of the day (1 - 31)
DINT[3] hour (0 - 23)
DINT[4] minute (0 - 59)
DINT[5] second (0 - 59)
DINT[6] microseconds (0 - 999,999)