Вы находитесь на странице: 1из 3

Appendix

A.3.4.5

Format of the Parameter Type ANY


STEP 7 stores the parameter type ANY in 10 bytes. When constructing a
parameter of the type ANY, you must ensure that all 10 bytes are occupied
because the called block evaluates the whole contents of the parameter. If, for
example, you specify a DB number in byte 4, you must also explicitly specify the
memory area in byte 6.
STEP 7 manages the data of elementary and complex data types differently from
the data for parameter types.

ANY Format for Data Types


For elementary and complex data types STEP 7 stores the following data:
x

Data types

x

Repetition factor

x

DB number

x

Memory area in which the information is stored

x

Start address of the data


'DWDIURPHOHPHQWDU\DQGFRPSOH[GDWDW\SHV

%\WH
%\WH
KIRU6
'DWDW\SH
%\WH
%\WH
%\WH

5HSHWLWLRQIDFWRU
'%QXPEHU RU

%\WH
%\WH

0HPRU\DUHDEEE %\WH

%\WH EEEEEEEEEEEEE[[[ %\WH


E %\WHDGGUHVV[ %LWDGGUHVV

The repetition factor identifies a quantity of the indicated data type to be transferred
by the parameter type ANY. This means you can specify a data area and also use
arrays and structures in conjunction with the parameter type ANY. STEP 7
identifies arrays and structures as a number (with the help of the repetition factor)
of data types. If, for example, 10 words are to be transferred, the value 10 must be
entered for the repetition factor and the value 04 must be entered for the data type.
The address is stored in the format Byte.Bit where the byte address is stored in bits
0 to 2 of byte 7, in bits 0 to 7 of byte 8, and in bits 3 to 7 of byte 9. The bit address
is stored in bits 0 to 2 of byte 9.
With a null pointer of the type NIL all bytes from byte 1 are assigned 0.

A-58

Programming with STEP 7


A5E00706944-01

Appendix

The following tables show the coding of the data types or of the memory areas for
the parameter type ANY.
Coding of the Data Types
Hexadecimal Code

Data Type

Description

b#16#00

NIL

Null pointer

b#16#01

BOOL

Bits

b#16#02

BYTE

Bytes (8 bits)

b#16#03

CHAR

Characters (8 bits)

b#16#04

WORD

Words (16 bits)

b#16#05

INT

Integers (16 bits)

B#16#06

DWORD

Words (32 bits)

b#16#07

DINT

Double integers (32 bits)

b#16#08

REAL

Floating-point numbers (32 bits)

b#16#09

DATE

Date

b#16#0A

TIME_OF_DAY (TOD)

Time of day

b#16#0B

TIME

Time

b#16#0C

S5TIME

Data type S5TIME

b#16#0E

DATE_AND_TIME (DT) Date and time (64 bits)

b#16#13

STRING

String

Coding of the Memory Areas


HexadecimalCode

Area

Description

b#16#81

Input area

b#16#82

Output area

b#16#83

Bit memory area

b#16#84

DB

Data block

b#16#85

DI

Instance data block

b#16#86

Local data (L stack)

b#16#87

Previous local data

Programming with STEP 7


A5E00706944-01

A-59

Appendix

ANY Format for Parameter Types


For parameter types STEP 7 stores the data type and the address of the
parameters. The repetition factor is always 1. Bytes 4, 5, and 7 are always 0. Bytes
8 and 9 indicate the number of the timer, counter, or block.

'DWDIURPSDUDPHWHUW\SHV WLPHUVFRXQWHUVEORFNV

%\WH

KIRU6

'DWDW\SH

%\WH

%\WH

5HSHWLWLRQIDFWRU 

%\WH

%\WH

'%QXPEHU RU

%\WH

%\WH

'DWDW\SH %\WH

%\WH

1XPEHURIWLPHUFRXQWHURUEORFN

%\WH

The following table shows the coding of the data types for the parameter type ANY
for parameter types.
Hexadecimal Code

A-60

Data Type

Description

b#16#17

BLOCK_FB

FB number

b#16#18

BLOCK_FC

FC number

b#16#19

BLOCK_DB

DB number

b#16#1A

BLOCK_SDB

SDB number

b#16#1C

COUNTER

Counter number

b#16#1D

TIMER

Timer number

Programming with STEP 7


A5E00706944-01