Time And Date Data Types - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Calculations that involve a long series of values including very large and very small numbers
can produce inaccurate results. This can occur if the numbers differ by 10 to the power of x,
where x > 6 (Real), or 15 (LReal). For example (Real): 100 000 000 + 1 = 100 000 000.
4.4.4

Time and Date data types

Table 4- 29
Time and date data types
Data type
Size
Time
32 bits
Date
16 bits
Time_of_Day
32 bits
DTL
12 bytes
(Date and Time
Long)
Time
TIME data is stored as a signed double integer interpreted as milliseconds. The editor format
can use information for day (d), hours (h), minutes (m), seconds (s) and milliseconds (ms).
It is not necessary to specify all units of time. For example T#5h10s and 500h are valid.
The combined value of all specified unit values cannot exceed the upper or lower limits in
milliseconds for the Time data type (-2,147,483,648 ms to +2,147,483,647 ms).
Date
DATE data is stored as an unsigned integer value which is interpreted as the number of days
added to the base date 01/01/1990, to obtain the specified date. The editor format must
specify a year, month and day.
TOD
TOD (TIME_OF_DAY) data is stored as an unsigned double integer which is interpreted as
the number of milliseconds since midnight for the specified time of day (Midnight = 0 ms).
The hour (24hr/day), minute, and second must be specified. The fractional second
specification is optional.
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Range
T#-24d_20h_31m_23s_648ms to
T#24d_20h_31m_23s_647ms
Stored as: -2,147,483,648 ms to +2,147,483,647
ms
D#1990-1-1 to D#2168-12-31
TOD#0:0:0.0 to TOD#23:59:59.999
Min.: DTL#1970-01-01-00:00:00.0
Max.: DTL#2554-12-31-23:59:59.999 999 999
PLC concepts
4.4 Data types
Constant Entry Examples
T#5m_30s
T#1d_2h_15m_30s_45ms
TIME#10d20h30m20s630ms
500h10000ms
10d20h30m20s630ms
D#2009-12-31
DATE#2009-12-31
2009-12-31
TOD#10:20:30.400
TIME_OF_DAY#10:20:30.400
23:10:1
DTL#2008-12-16-20:30:20.250
113

Advertisement

Table of Contents
loading

Table of Contents