97BPLC concepts
4.4 Data types
S7-1200 Programmable controller
90
System Manual, 11/2011, A5E02486680-05
DTL
DTL (Date and Time Long) data type uses a12 byte structure that saves information on date
and time. You can define DTL data in either the Temp memory of a block or in a DB. A value
for all components must be entered in the "Start value" column of the DB editor.
Table 4- 20 Size and range for DTL
Length
(bytes)
Format
Value range
Example of value input
12
Clock and calendar
Year-Month-Day:Hour:Minute:
Second.Nanoseconds
Min.: DTL#1970-01-01-00:00:00.0
Max.: DTL#2554-12-31-23:59:59.999
999 999
DTL#2008-12-16-20:30:20.250
Each component of the DTL contains a different data type and range of values. The data
type of a specified value must match the data type of the corresponding components.
Table 4- 21 Elements of the DTL structure
Byte
Component
Data type
Value range
0
1
Year
UINT
1970 to 2554
2
Month
USINT
1 to 12
3
Day
USINT
1 to 31
4
Weekday
1
USINT
1(Sunday) to 7(Saturday)
1
5
Hour
USINT
0 to 23
6
Minute
USINT
0 to 59
7
Second
USINT
0 to 59
8
9
10
11
Nanoseconds
UDINT
0 to 999 999 999
1
The weekday is not considered in the value entry.
Table 4- 22 Character and String data types
Data type
Size
Range
Constant Entry Examples
Char
8 bits
ASCII character codes: 16#00 to 16#FF
'A', 't', '@'
String
n+ 2 bytes n = (0 to 254 character bytes)
'ABC'
Char
Char data occupies one byte in memory and stores a single character coded in ASCII
format. The editor syntax uses a single quote character before and after the ASCII character.
Visible characters and control characters can be used. A table of valid control characters is
shown in the description of the String data type.