l
Function Block Instance
When you place an instance of a function block definition in a program or another function block,
the function block definition is treated as a part of that program or function block.
Function block definitions that are called from a program or another function block are called
"instances".
Every instance of a function block has an identifier known as an instance name associated with it,
and every instance uses memory
.
You can use a single function block definition to create more than one "instance". This allows you
to process different I/O data with the same function.
Instance name
Instance name
Algorithm
FB1
FB1_1
Algorithm
FB1
FB1_2
Program POU
Variable
declarations
Variable
declarations
Memory area
Memory for
instance
FB1_2
Memory for
instance
FB1_1
Function block definition name
Memory area
reserved.
Function block definition name
Memory area reserved.
If you place instance names FB1_1 and FB1_2
for function block FB1 in the program, each in-
stance requires its own space in memory
.
"Instances" cannot be read from other programs or function blocks. If an instance with the same
name as another instance is placed in a different program or another function block, that instance
will operate as a completely separate instance.
Precautions for Correct Use
In the following conditions, a user-defined function block will cause an error during the program
check when the program is built.
•
The same function block instance was called more than once in the POU.
•
The instance of the function block was registered as a global variable.
6 Programming
6 - 9
NX-series Safety Control Unit User's Manual (Z930)
6-1 POUs (Program Organization Units)
6
6-1-5 Details on Function Blocks