Variant" Pointer Data Type; Accessing A "Slice" Of A Tagged Data Type - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

97BPLC concepts
4.4 Data types
Hexadecimal code
b#16#06
b#16#07
b#16#36
b#16#08
b#16#0B
b#16#13
Table 4- 30
Hexadecimal code
b#16#81
b#16#82
b#16#83
b#16#84
b#16#85
b#16#86
b#16#87
4.4.7.3

"Variant" pointer data type

The data type Variant is 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 4- 31
Properties of the Variant pointer
Length
Representation
(Byte)
0
Symbolic
Absolute
4.4.8

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)
96
Data type
DWord
DInt
UDInt
Real
Time
String
Memory area encoding in the ANY pointer:
Memory area
I
Q
M
DBX
DIX
L
V
Format
Operand
DB_name.Struct_name.element_name
Operand
DB_number.Operand Type Length
Description
32-bit double word
32-bit double integer
32-bit-unsigned double integer
32-Bit floating point
Time
Character string
Description
Input memory area
Output memory area
Marker memory area
Data block
Instance data block
Local data
Previous local data
Example entry
MyTag
MyDB.Struct1.pressure1
%MW10
P#DB10.DBX10.0 INT 12
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents