97BPLC concepts
4.4 Data types
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
95
4.4.7.2
"Any" pointer data type
The pointer data type ANY ("Any") points to the beginning of a data area and specifies its
length. The ANY pointer uses 10 bytes in memory and can include the following information:
●
Data type: Data type of the data elements
●
Repeat factor: Number of data elements
●
DB Number: Data block in which data elements are stored
●
Storage area: Memory area of the CPU, in which the data elements are stored
●
Start address: "Byte.Bit" starting address of the data
The following image shows the structure of the ANY pointer:
0HPRU\DUHD
5HSHDWIDFWRU
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
%\WH
'%1XPEHURU
'DWDW\SH
KIRU6
E
E
E
E
E
E
E
E
E
E
E
E
E
E
E
E
E %\WHDGUHVV
[ %LWDGUHVV
%LW
%LW
[
[
[
A pointer can not detect ANY structures. It can only be assigned to local variables.
Table 4- 28 Format and examples of the ANY pointer:
Format
Entry example
Description
P#Data_block.Memory_area
Data_address Type Number
P#DB 11.DBX 20.0 INT 10
10 words in global DB 11
starting from DBB 20.0
P#M 20.0 BYTE 10
10 bytes starting from MB 20.0
P#Memory_area Data_address
Type Number
P#I 1.0 BOOL 1
Input I1.0
Table 4- 29 Data type encoding in the ANY pointer
Hexadecimal code
Data type
Description
b#16#00
Null
Null pointer
b#16#01
Bool
Bits
b#16#02
Byte
Bytes, 8 Bits
b#16#03
Char
8-bit character
b#16#04
Word
16-bit-word
b#16#05
Int
16-bit-integer
b#16#37
SInt
8-bit-integer
b#16#35
UInt
16-bit unsigned integer
b#16#34
USInt
8-bit unsigned integer