ANY

Top  Previous  Next

 

This data type is a pointer that points at any data area and determines at the same time how many data of which type can be found there.

A typical notation is:

 

      P#M22.0 WORD 3

 

This expression names the marker words MW 22, MW 24 and MW 26. That is why the data type ANY has got many things in common with the data type ARRAY. While calling a FB with an array parameter all elements of the array are really transfered, only the 10 bytes that are necessary for the specification of an ARRAY are transfered calling with an ANY parameter.

 

But you can also specify a marker word, a structure in a DB or in the local data as actual-parameter for an ANY.

 

ANYs are quite difficult to handle and if it is not necessary we recommend not to use them in TrySim. Unfortunately we have to admit that we did not understand the valid syntax and semantics of the ANYs in STEP®7 completely. In addition to this it seems to change slightly from STEP®7 version to STEP®7 version. If you have got any problems with ANYs please contact us immediately, here a mistake by us is so probably like in no other area of TrySim.

 

If you connect an operand to a parameter that is declared as ANY please note the following characteristics:

 

1.) You can write the operand as constant like it is described above:

 

e.g.   P#DB100.DBX 3.0 S5TIME 3

 

Then the 10 bytes that are necessary for the specification of these constants are transfered to the called block without modification.

 

2.) You can also specify parameter and variables as operands which are declared in the block header. The translater determines automatically the correct address. (Unfortunately it writes it like this then, that is why you hardly recognize your operand but we are going to change this sometime.) During runtime the following conversions are still done:

2.a) If it is about a parameter or a static variable not the identification 85h (for instance data) will be transfered but the identification 84h (for global DB) and the current IDB-No.

2.b) If it is about a local variable not the identification 86h will be transfered but the identification 87h (for further local data).

2.c) You cannot transfer parameter of functions (FC) to an ANY-parameter

3.) But if you specify a parameter or a variable that is declared as ANY the address of this parameter is not transfered exceptionally but the 10 bytes that are at this address are transfered.

 

See also:

Internal ANY Data Format

Pointer

Data Types

 

STEP®7 is a registered trademark of the Siemens AG.