Statement Descriptions
b. Calling a function block from another function block
Program
Instance_ST
ST
Variable Settings
• Setting the variables of the ST program and SFC program (call source)
The ST program and SFC program have the following variables, and the
following values are passed with the called function block.
Variable name in ST task/
SFC program
IN1
IN2
IN3
OUT1
OUT2
OUT3
A
Note Data type: BOOL
B
Note Data type: BOOL
Instance_FB
Note Data type: FUNC-
TIONBLOCK
• Function block (call source) variable settings
The function block (call source) has the following variables, and the follow-
ing values are passed with the called function block.
Variable type
source) variable name
Input variables
IN1
IN2
IN3
Output variables
OUT1
OUT2
OUT3
Function block (ST)
(ST)
Example) ...
...,...);
Instance_FB(
INSTANCE_FB is an instance name of data type FUNCTIONBLOCK.
Values passed to (or received from) variables in
the called function block
Passed to FB_IN1 (input variable).
Passed to FB_IN2 (input variable).
Passed to FB_IN3 (input variable).
Received from FB_OUT1 (output variable).
Received from FB_OUT2 (output variable).
Received from FB_OUT3 (output variable).
Passed to EN (internal variable).
Received from ENO (internal variable).
Calling function block definition: Function block
Function block (call
Passed to FB2_IN1.
Passed to FB2_IN2.
Passed to FB2_IN3.
Received from FB2_OUT1.
Received from FB2_OUT2.
Received from FB2_OUT3.
Section 5-5
Function block (FB)
(Ladder diagram)
Function block (FB)
(ST)
Example) ...
Values passed to (or received
from) variables in the called
function block
163
Need help?
Do you have a question about the CX-PROGRAMMER V8.1 and is the answer not in the manual?