Function Blocks
Registration of Instances
12
Function Block Definition
Example: CONTROL
Algorithm
Variables
Example:
There are 3 FB
instances and each
has its own I/O and
internal variables.
If internal variables are not used, if processing will not be affected, or if the
internal variables are used in other locations, the same instance name can be
used at multiple locations in the program.
The same instance can be
used at multiple locations.
Function block definition
Instance
Example: CONTROL
CASCADE
Algorithm
Variables
Some precautions are required when using the same memory area. For
example, if the same instance containing a timer instruction is used in more
than one program location, the same timer number will be used causing coil
duplication, and the timer will not function properly if both instructions are exe-
cuted.
Each instance name is registered in the global symbol table as a file name.
Program
Instance (sample) of function block definition A
a
b
c
The instance is registered in the
global symbol table with the instance
name as the symbol name.
Name
Data type
sample FB [FunctionBlock1]
The function block definition
name is registered after FB in
square parentheses [ ].
Instance name
Cyclic task 0
Instance
CASCADE_01
P_On
Algorithm
&20
Internal and I/O
&10
variables
Instance
CASCADE_02
P_On
Algorithm
&15
Internal and I/O
&10
variables
Cyclic task 1
Instance
CASCADE_03
P_On
Algorithm
&7
Internal and I/O
&8
variables
Cyclic task 0
CASCADE
P_On
CONTROL
EN
&100
PARA_1
&130
PARA_2
CASCADE
P_On
CONTROL
Algorithm
EN
&50
Internal and I/O
PARA_1
variables
&150
PARA_2
Cyclic task 1
CASCADE
P_On
CONTROL
EN
&100
PARA_1
&200
PARA_2
Address/
value
N/A[Auto]
Section 1-2
CASCADE_01
1.0
CONTROL
EN
ENO
ON_TIME
OFF_TIME
CASCADE_02
1.1
CONTROL
EN
ENO
ON_TIME
OFF_TIME
CASCADE_03
1.2
CONTROL
EN
ENO
ON_TIME
OFF_TIME
1.0
ENO
1.1
ENO
1.2
ENO
Need help?
Do you have a question about the CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION and is the answer not in the manual?