50
Instance Specifications
Section 2-3
Operation when the
Instance Is Not Executed
When the input to the function block’s EN input variable is OFF, the function
block is not called, so the internal variables of the instance do not change (val-
ues are retained). In the same way the output variables do not change when
EN is OFF (values are retained).
!Caution
An instance will not be executed while its EN input variable is OFF, so Differ-
entiation and Timer instructions will not be initialized while EN is OFF. If Differ-
entiation or Timer instructions are being used, use the Always ON Flag
(P_On) for the EN input condition and include the instruction’s input condition
within the function block definition.
Nesting
With CX-Programmer Ver. 6.0 and later versions, a function block can be
called from another function block, i.e., nesting is supported. Function blocks
can be nested up to 8 levels (including the function block called from the pro-
gram).
The calling function block and called function block can be either ST lan-
guage, ladder language, or either combination of the two.
The function block nesting levels can also be displayed in a directory tree for-
mat with the FB Instance Viewer function.
The nested function blocks’ function block definitions are included in the func-
tion block library file (.cxf) containing the calling function block’s definitions.
FB
EN ENO
1.0
P_Off
P_On
ENO
1.0
P_Off
P_On
Program
FB definition
Body
Execution results:
Output variable 1.0 is turned OFF, but
internal variable a retains its previous value.
If the programming were entered
directly into the program instead of in a
function block definition, both bit 1.0
and variable a would be turned OFF.
Program
Internal
variable a
Internal
variable a
FB0
INSTANCE_FB0
FB1
FB0 (ST)
Example:
INSTANCE_FB1 (A:=FB1__OUT1,B=:>FB1_IN1)
;
INSTANCE_FB1
FB2
INSTANCE_FB2
FB8
INSTANCE_FB8
7th
FB1 (ST)
Example:
INSTANCE_FB2 (...,..)
FB7 (ST)
Example:
INSTANCE_FB8 (...,..)
8th
FB8 (ST)
Example:
Program
FB0: Ladder diagram
FB1: Ladder diagram
FB7: Ladder diagram
FB8: Ladder diagram
1st
2nd
"INSTANCE_FB1," "INSTANCE_FB2," etc., are the FUNCTION BLOCK data type instance names.
Note: Any combination of ladder diagrams and structured text programming can be used between the called and the calling function block.
Содержание CX-PROGRAMMER V8.1
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ......
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 25: ...xxvi Application Precautions 4...
Страница 26: ...Part 1 Function Blocks...
Страница 27: ......
Страница 153: ...128 Procedures Section 3 2...
Страница 154: ...Part 2 Structured Text ST...
Страница 155: ......
Страница 159: ...134 CX Programmer Specifications Section 4 2...
Страница 205: ...180 Procedures Section 6 1...
Страница 207: ...182 System defined external variables supported in function blocks Appendix A...
Страница 229: ...204 Revision History...
Страница 230: ......