Technical data

Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 609
27.3.4 Parameter Types
In addition to elementary and complex data types, you can also define parameter types for formal
parameters that are transferred between blocks. STEP 7 recognizes the following parameter types:
TIMER or COUNTER: this specifies a particular timer or particular counter that will be used
when the block is executed. If you supply a value to a formal parameter of the TIMER or
COUNTER parameter type, the corresponding actual parameter must be a timer or a counter,
in other words, you enter "T" or "C" followed by a positive integer.
BLOCK: specifies a particular block to be used as an input or output. The declaration of the
parameter determines the block type to be used (FB, FC, DB etc.). If you supply values to a
formal parameter of the BLOCK parameter type, specify a block address as the actual
parameter. Example: "FC101" (when using absolute addressing) or "Valve" (with symbolic
addressing).
POINTER: references the address of a variable. A pointer contains an address instead of a
value. When you supply a value to a formal parameter of the parameter type POINTER, you
specify an address as the actual parameter. In STEP 7, you can specify a pointer in the pointer
format or simply as an address (for example, M 50.0). Example of a pointer format for
addressing the data beginning at M 50.0: P#M50.0
ANY: this is used when the data type of the actual parameter is unknown or when any data
type can be used. For more information about the ANY parameter type, refer to the sections
"Format of the Parameter Type ANY" and "Using the Parameter Type ANY".
A parameter type can also be used in a user-defined data type (UDT). For more information about
UDTs, refer to the section "Using User-Defined Data Types to Access Data".
Parameter Capacity Description
TIMER 2 bytes Indicates a timer to be used by the program in the called logic block.
Format: T1
COUNTER 2 bytes Indicates a counter to be used by the program in the called logic block.
Format: C10
BLOCK_FB
BLOCK_FC
BLOCK_DB
BLOCK_SDB
2 bytes Indicates a block to be used by the program in the called logic block.
Format: FC101
DB42
POINTER 6 bytes Identifies the address.
Format: P#M50.0
ANY 10 Bytes Is used when the data type of the current parameter is unknown.
Format:
P#M50.0 BYTE 10
ANY format for data types
P#M100.0 WORD 5
L#1COUNTER 10 ANY format for
parameter types