PLC concepts
5.4 Data types
S7-1200 Programmable controller
134 System Manual, V4.2, 09/2016, A5E02486680-AK
Variant pointer data type
The data type Variant can point to variables of different data types or parameters. The
Variant pointer can point to structures and individual structural components. The Variant
pointer does not occupy any space in memory.
Table 5- 40 Properties of the Variant pointer
0 Symbolic
DB_name.Struct_name.element_name MyDB.Struct1.pressure1
Absolute
DB_number.Operand Type Length
Accessing a "slice" of a tagged data type
PLC tags and data block tags can be accessed at the bit, byte, or word level depending on
their size. The syntax for accessing such a data slice is as follows:
● "<PLC tag name>".xn (bit access)
● "<PLC tag name>".bn (byte access)
● "<PLC tag name>".wn (word access)
● "<Data block name>".<tag name>.xn (bit access)
● "<Data block name>".<tag name>.bn (byte access)
● "<Data block name>".<tag name>.wn (word access)
A double word-sized tag can be accessed by bits 0 - 31, bytes 0 - 3, or word 0 - 1. A word-
sized tag can be accessed by bits 0 - 15, bytes 0 - 1, or word 0. A byte-sized tag can be
accessed by bits 0 - 7, or byte 0. Bit, byte, and word slices can be used anywhere that bits,
bytes, or words are expected operands.