Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 619
27.3.4.6 Using the Parameter Type ANY
You can define formal parameters for a block that are suitable for actual parameters of any data
type. This is particularly useful when the data type of the actual parameter that is provided when
the block is called is unknown or can vary (and when any data type is permitted). In the variable
declaration of the block, you declare the parameter as data type ANY. You can then assign an
actual parameter of any data type in STEP 7.
STEP 7 assigns 80 bits of memory for a variable of the ANY data type. If you assign an actual
parameter to this formal parameter, STEP 7 codes the start address, the data type, and the length
of the actual parameter in the 80 bits. The called block analyzes the 80 bits of data saved for the
ANY parameter and obtains the information required for further processing.
Assigning an Actual Parameter to an ANY Parameter
If you declare the data type ANY for a parameter, you can assign an actual parameter of any data
type to the formal parameter. In STEP 7, you can assign the following data types as actual
parameters:
Elementary data types: you specify the absolute address or the symbolic name of the actual
parameter.
Complex data types: you specify the symbolic name of the data with a complex data type (for
example, arrays and structures).
Timers, counters, and blocks: you specify the number (for example, T1, C20, or FB6).
The following figure shows how data are transferred to an FC with parameters of the ANY data
type.