0% found this document useful (0 votes)
50 views1 page

Understanding PLC System Time Types

The document discusses different time data types used in SIMATIC projects including: 1) S5TIME and TIME which are elementary types with short and long time ranges respectively. 2) DATE and TIME_OF_DAY which represent the number of days or milliseconds since a start date. 3) DT(DATE_AND_TIME) which is a complex 8-byte type storing date and time in BCD format across 8 bytes. The document recommends using the TIME_OF_DAY elementary type for intervals less than a day but using the DATE_AND_TIME complex type for configuration times that may have long intervals.

Uploaded by

bassel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Understanding PLC System Time Types

The document discusses different time data types used in SIMATIC projects including: 1) S5TIME and TIME which are elementary types with short and long time ranges respectively. 2) DATE and TIME_OF_DAY which represent the number of days or milliseconds since a start date. 3) DT(DATE_AND_TIME) which is a complex 8-byte type storing date and time in BCD format across 8 bytes. The document recommends using the TIME_OF_DAY elementary type for intervals less than a day but using the DATE_AND_TIME complex type for configuration times that may have long intervals.

Uploaded by

bassel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

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

You might also like