97BPLC concepts
4.4 Data types
S7-1200 Programmable controller
86
System Manual, 11/2011, A5E02486680-05
4.4
Data types
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.
A formal parameter is the identifier on an instruction that marks the location of data to be
used by that instruction (example: the IN1 input of an ADD instruction). An actual parameter
is the memory location or constant containing the data to be used by the instruction
(example %MD400 "Number_of_Widgets"). The data type of the actual parameter specified
by you must match one of the supported data types of the formal parameter specified by the
instruction.
When specifying an actual parameter, you must specify either a tag (symbol) or an absolute
(direct) memory address. Tags associate a symbolic name (tag name) with a data type,
memory area, memory offset, and comment, and can be created either in the PLC tags
editor or in the Interface editor for a block (OB, FC, FB and DB). If you enter an absolute
address that has no associated tag, you must use an appropriate size that matches a
supported data type, and a default tag will be created upon entry.
All data types except String are available in the PLC tags editor and the block Interface
editors. String is available only in the block Interface editors. You can also enter a constant
value for many of the input parameters.
●
Bit and Bit sequences (Page 87): Bool (Boolean or bit value), Byte (8-bit byte value),
Word (16-bit value), DWord (32-bit double-word value)
●
Integer (Page 88)
–
USInt (unsigned 8-bit integer), SInt (signed 8-bit integer),
–
UInt (unsigned 16-bit integer), Int (signed 16-bit integer)
–
UDInt (unsigned 32-bit integer), DInt (signed 32-bit integer)
●
Floating-point Real (Page 88): Real (32-bit Real or floating-point value), LReal (64-bit
Real or floating-point value)
●
Time and Date (Page 89): Time (32-bit IEC time value), Date (16-bit date value), TOD
(32-bit time-off-day value), DT (64-bit date-and-time value)
●
Character and String (Page 89): Char (8-bit single character), String (variable-length
string of up to 254 characters)
●
●
Data structure (Page 92): Struct
●
●
Pointers (Page 94): Pointer, Any, Variant
Although not available as data types, the following BCD numeric format is supported by the
conversion instructions.