Omron CX-PROGRAMMER V8.1 Operation Manual page 75

Function blocks/ structured text
Table of Contents

Advertisement

Instance Specifications
Operation when the
Instance Is Not Executed
!Caution An instance will not be executed while its EN input variable is OFF, so Differ-
Nesting
Program
INSTANCE_FB0
FB0
1st
50
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).
Program
P_Off
FB
EN
ENO
Execution results:
Output variable 1.0 is turned OFF, but
internal variable a retains its previous value.
Program
P_Off
P_On
Internal
variable a
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.
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.
FB0: Ladder diagram
FB1: Ladder diagram
INSTANCE_FB1
2nd
FB1
FB0 (ST)
Example:
Example:
;
INSTANCE_FB1 (A:=FB1__OUT1,B=:>FB1_IN1)
INSTANCE_FB2 (...,..)
"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.
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 definition
1.0
P_On
If the programming were entered
directly into the program instead of in a
1.0
function block definition, both bit 1.0
and variable a would be turned OFF.
FB7: Ladder diagram
INSTANCE_FB2
FB2
7th
FB1 (ST)
Example:
INSTANCE_FB8 (...,..)
Section 2-3
Body
ENO
Internal
variable a
FB8: Ladder diagram
INSTANCE_FB8
FB8
8th
FB7 (ST)
FB8 (ST)
Example:

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents