SYSTEM TIME
We discuss before about System time when I do the Process function,
Review of time types:
Elementary type:
- S5TIME length 16 bits with BCD format, used for SIMATIC timers with short time
less than 2H_ 46m_30S not used in our project example : S5T#5s,
- TIME (IEC TIME) length 32 bits with decimal format of millisecond, max value
2147486470 ms = T#24d20h31m23s647ms,
- DATE represent the number of days since 01.01.1990 (for example: D#2168-12-31 =
W#16#FF62),
- TIME_OF_DAY (TOD) This variable contains the number of milliseconds since the
beginning of the day (0:00 o‘clock) in the form of an unsigned integer. (for example:
TOD#23:59:59.999 = DW#16#05265B77).
Complex type:
DT(DATE_AND_TIME): length 8 bytes with BCD format (64bits)
Byte0 = year, byte1 = month, Byte2 = Day, Byte3 = Hour, Byte4 = Minute, Byte5 = Second,
Byte 6 = 2decads of millisecond, Byte7 = one decade of millisecond, 2 nd decade DayOfWeek .
We use this type on the black box functions.
Please note: we have 10 time data type on the hardware runtime data, we was use the time
of day (TOD) elementary (32bit) data type to represent them,
This is good and has meaning for interval less than one day, but with long interval it has no
meaning.
Per example:
NextPollingTime : Time : here I use CPU absolute time , no need time stamp,
TimeOfChange : we was use TOD (32bit) time stamp because is frequently change,
For ACK and Reset and Last Change configuration time must Be Date and Time complex data.
Please check it and let me know