Download Structured Control Language (SCL) for S7-300/S7-400
Transcript
Calling Functions and Function Blocks 16.3.2 Input Assignment (FC) Basic Principle Input assignments assign values (actual parameters) to the formal input parameters of the called FC. The FC can work with these actual parameters but cannot change them. In contrast to an FB call, this assignment is not optional with an FC call. Input assignments have the follwing syntax: Input Assignment Actual parameters Expression TIMER IDENTIFIER := IDENTIFIER Parameter name of the input parameter (formal parameter) Figure 16-12 Actual Parameters in Input Assignments COUNTER IDENTIFIER BLOCK IDENTIFIER Syntax of an Input Assignment The following actual parameters can be assigned in input assignments: Table 16-4 Actual Parameters in Input Assignments Explanation Actual Parameter Expression An expression represents a value and consists of addresses and operators. The following types of expression are possible: Mathematical, logical or comparative expressions Constants Extended variables Special Consideration 16-16 TIMER/COUNTER Identifier Defines a specific timer or counter to be used when a block is processed (see also Chapter 17). BLOCK Identifier Defines a specific block to be used as an input parameter. The block type (FB, FC or DB) is specified in the declaration of the input parameter. When assigning parameters, you specify the block address. You can use either the absolute or the symbolic address (see also Chapter 9). Note that FB in/out parameters and FC parameters are not permissible as actual parameters for formal FC input parameters of a non-elementary data type. Structured Control Language (SCL) for S7-300/S7-400, Programming C79000-G7076-C522-01