PLC concepts made easy
4.4 Memory areas, addressing and data types
4.4.1
Data types supported by the S7-1200
Data types are used to specify both the size of a data element as well as how the data are to
be interpreted. Each instruction parameter supports at least one data type, and some
parameters support multiple data types. Hold the cursor over the parameter field of an
instruction to see which data types are supported for a given parameter.
Table 4- 4
Data types supported by the S7-1200
Data types
Bit and bit-sequence
data types
Integer data types
Real number data
types
Date and time data
types
Character and string
data types
60
Description
Bool is a Boolean or bit value.
Byte is an 8-bit byte value.
Word is a 16-bit value.
DWord is a 32-bit double-word value.
USInt (unsigned 8-bit integer) and SInt (signed 8-bit integer) are "short" integers (8 bits or 1
byte of memory) that can be signed or unsigned.
UInt (unsigned 16-bit integer) and Int (signed 16-bit integer) are integers (16 bits or 1 word of
memory) that can be signed or unsigned.
UDInt (unsigned 32-bit integer) and DInt (signed 32-bit integer) are double integers (32 bits or
1 double-word of memory) that can be signed or unsigned.
Real is a 32-bit Real number or floating-point value.
LReal is a 64-bit Real number or floating-point value.
Date is a 16-bit date value (similar to a UInt) that contains the number of days since January
1, 1990. The maximum date value is 65535 (16#FFFF), which corresponds to June 6, 2169.
All possible Date values are valid.
DTL (date and time long) is a structure of 12 bytes that saves information on date and time in
a predefined structure.
–
Year (UInt): 1970 to 2554
–
Month (USInt): 1 to 12
–
Weekday (USInt): 1 (Sunday) to 7 (Saturday)
–
Hours (USInt): 0 to 23
–
Minutes (USInt): 0 to 59
–
Seconds (USInt): 0 to 59
–
Nanoseconds (UDInt): 0 to 999999999
Time is a 32-bit IEC time value (similar to a Dint) that stores the number of milliseconds (from
0 to 24 days 20 hours 31 minutes 23 seconds and 647 ms). All possible Time values are
valid. Time values can be used for calculations, and negative times are possible.
TOD (time of day) is a 32-bit time-of-day value (similar to a Dint) that contains the number of
milliseconds since midnight (from 0 to 86399999).
Char is an 8-bit single character.
String is a variable-length string of up to 254 characters.
Easy Book
Manual, 11/2011, A5E02486774-04