any

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. Figure 1: ANY structure Data Type BOOL BYTE CHAR WORD INT DWORD DINT REAL DATE TOD TIME S5TIME DT STRING BLOCK_FB BLOCK_FC BLOCK_SDB COUNTER TIMER BLOCK_DB 01 02 03 04 05 06 07 08 09 0A 0B 0C 0E 13 17 18 1A 1C 1D 19 ANY pointer restructure Data Type <= 13 Data Type >= 17 16#10 TYPE 16#0001 16#0000 16#0000 NUMBER 16#10 TYPE QUANTITY DB NUMBER INITIAL POINTER Byte n + 0 Byte n + 1 Byte n + 2 Byte n + 3 Byte n + 4 Byte n + 5 Byte n + 6 Byte n + 7 Byte n + 8 Byte n + 9

Upload: nileshsbodke

Post on 19-Dec-2015

212 views

Category:

Documents


0 download

DESCRIPTION

any

TRANSCRIPT

Page 1: Any

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.

Figure 1: ANY structure

Data Type

BOOL

BYTE

CHAR

WORD

INT

DWORD

DINT

REAL

DATE

TOD

TIME

S5TIME

DT

STRING

BLOCK_FB

BLOCK_FC

BLOCK_SDB

COUNTER TIMER

BLOCK_DB

01

02

03

04

05

06

07

08

09

0A

0B

0C

0E

13

17

18

1A

1C 1D

19

ANY pointer restructure

Data Type <= 13 Data Type >= 17

16#10

TYPE

16#0001

16#0000

16#0000

NUMBER

16#10

TYPE

QUANTITY

DB NUMBER

INITIAL POINTER

Byte n + 0

Byte n + 1

Byte n + 2

Byte n + 3

Byte n + 4

Byte n + 5

Byte n + 6

Byte n + 7

Byte n + 8

Byte n + 9

Page 2: Any

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.

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.

Initial pointer restructure

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

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 X X X

31 3 26 24 18

X = Bit address

Y = Byte address

Y Y