ANY Pointer Restructure

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

How is an ANY pointer structured?

An ANY pointer is a STEP 7 variable that contains the addresses of a continuous range of
variables (area pointer). It is very used in automation programs to indicate transfer areas from of
many different sources and target, like in the communication tasks, for example.

An ANY pointer is a complex variable that takes 10 bytes.


The restructure of an ANY pointer can vary in dependence of the type of variable that it
represents. The information about the type of variable that it represents makes also part of an
ANY pointer structure.

The follow figure shows how a ANY pointer is structured in function of the data type.

ANY pointer restructure

Data Type <= 13 Data Type >= 17 Data Type

Byte n + 0 16#10 16#10 01 BOOL

Byte n + 1 TYPE TYPE 02 BYTE

Byte n + 2 QUANTITY 16#0001 03 CHAR


Byte n + 3 04 WORD

Byte n + 4 DB NUMBER 16#0000 05 INT


Byte n + 5 06 DWORD

Byte n + 6 INITIAL 16#0000 07 DINT


Byte n + 7 POINTER 08 REAL

Byte n + 8 NUMBER 09 DATE


Byte n + 9 0A TOD
0B TIME
0C S5TIME
0E DT
13 STRING
17 BLOCK_FB
18 BLOCK_FC
19 BLOCK_DB
1A BLOCK_SDB
1C COUNTER
1D TIMER

Figure 1: ANY structure


Any pointer with data types 01 to 13 uses a pointer as part of it. The follow figure shows how a
pointer is formed in this case.

Initial pointer restructure

31 26 24 18 3 0
1 0 0 0 0 Z Z Z 0 0 0 0 0 Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y X X X

X = Bit address

Y = Byte address

Z = Area codes:
000 Peripherals 001 Inputs (PAE)
010 Outputs (PAA) 011 Flag bits
100 Data in the DB register 101 Data in the DB reg.2 (DI)
110 Own local data 111 LD in the called block

Figure 2: Pointer structure

Note the information “DB Number” of ANY variable just makes senses if the area code of the
initial pointer is setting to an DB (ZZZ = 100 or ZZZ = 101). In any other cases, “DB Number”
should be set to zero.

Important:
The sample program is freeware. Any user can use copy and forward this program FREE OF
CHARGE. The authors and owners of this program take no responsibility whatsoever for the
functionality and compatibility of this software. Use of the software is entirely at the user's own
risk. Since this software is free of charge, there is no warranty, nor claim for error correction and
hotline support.

You might also like