Siemens 6AV6651-7KA01-3AA4 - S7-1200 + KTP400 Basic Starter Kit 6AV6651-7KA01-3AA4 Benutzerhandbuch

Produktcode
6AV6651-7KA01-3AA4
Seite von 364
PLC concepts made easy 
 
4.4 Memory areas, addressing and data types 
 
Easy Book 
60
 
Manual, 03/2014, A5E02486774-AF 
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- 3 
Data types supported by the S7-1200 
Data types 
Description 
Bit and bit-sequence 
data types 
 
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. 
Integer data types 
 
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 number data 
types 
 
Real is a 32-bit Real number or floating-point value. 
 
LReal is a 64-bit Real number or floating-point value. 
Date and time data 
types 
 
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 65378 (16#FF62), which corresponds to December 31, 
2168. 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 
–  Day (USInt): 1 to 31 
–  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). 
Character and string 
data types 
 
Char is an 8-bit single character. 
 
String is a variable-length string of up to 254 characters.