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

Data Type >= 17

Byte n + 0

16#10

16#10

01

BOOL

Byte n + 1

TYPE

TYPE

02

BYTE

Byte n + 2

QUANTITY

16#0001

03

CHAR

04

WORD

05

INT

06

DWORD

07

DINT

08

REAL

09

DATE

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

Byte n + 3
Byte n + 4

DB NUMBER

16#0000

Byte n + 5
Byte n + 6
Byte n + 7
Byte n + 8
Byte n + 9

Figure 1: ANY structure

INITIAL
POINTER

16#0000

NUMBER

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
1

26
0 0

Z Z

24
Z 0

18
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
010
Outputs (PAA)
100
Data in the DB register
110
Own local data

001
011
101
111

Inputs (PAE)
Flag bits
Data in the DB reg.2 (DI)
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