Specifications

4-12
4.2 POUs
4.2.8 Functions, function blocks, and operators
(3) Creating instances
When using function blocks, create instances to reserve internal variables.
Variables can be called from programs and other function blocks by creating instances for
function blocks.
To create an instance, declare as a label in a global label or local label of POU that uses
function blocks. Same function blocks can be instantiated with different names in a single
POU.
Function blocks perform operations using internal variables assigned to each instance.
If the same function is called in the circuit multiple times, the value of internal
variables or output variables is overwritten everytime the function is called. To
hold the value of internal variables or output variables when the function is called,
edit programs to use function blocks or to save the values as different valuables.
D13
D13
D13
Uses same internal variables
for same instances
Uses different internal variables
for different instances
Function block
Instance A
Function block Function block
Instance AInstance B
D10
D11
D12
D6200
D6201
D6203
D6204
D6202
D10
D11
D12
D6200
D6201
D6203
D6204
D6202
D10
D11
D12
Inp
ut label1
Input label1
Input label1
Input label1
Input label2
Input label3
Input label1
Input label2
Input label3
Local label
Output label
Output label
Local label
Output label
D6210
D6211
D6213
Local label
D6214
D6212