Procedures
3-2-4
Creating Instances from Function Block Definitions
Operands with Sizes Affected by Other Operands
Example: Five Transfer Words, D0 Specified for the First Source Word, and
D100 Specified for the First Destination Word for XFER(070)
As shown below, the variables must be changed to set the first elements in
two different arrays after the function block definition has been generated.
Example: DT_WORD1 and DT_WORD2 are set as WORD array variables
with 5 elements each. DT_WORD1[0] is specified for the first word for the first
operand and DT_WORD2[0] is specified for first word for the second operand
of XFER(070).
If a function block definition is registered in the global symbol table, either of
the following methods can be used to create instances.
Method 1:Select the function block definition, insert it into the program, and
input a new instance name. The instance will automatically be registered in
the global symbol table.
Method 2: Set the data type in the global symbol table to "FUNCTION
BLOCK," specify the function block definition to use, and input the instance
name to register it.
Note When using ST language, a function block can be called by select-
ing "FUNCTION BLOCK" as the variable's data type, using the de-
sired instance name, and entering a function block call statement.
↓
Section 3-2
97