163
Statement Descriptions Section 5-5
b. Calling a function block from another function block
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.
• 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 name in ST task/
SFC program
Values passed to (or received from) variables in
the called function block
IN1 Passed to FB_IN1 (input variable).
IN2 Passed to FB_IN2 (input variable).
IN3 Passed to FB_IN3 (input variable).
OUT1 Received from FB_OUT1 (output variable).
OUT2 Received from FB_OUT2 (output variable).
OUT3 Received from FB_OUT3 (output variable).
A
Note Data type: BOOL
Passed to EN (internal variable).
B
Note Data type: BOOL
Received from ENO (internal variable).
Instance_FB
Note Data type: FUNC-
TIONBLOCK
Calling function block definition: Function block
Variable type Function block (call
source) variable name
Values passed to (or received
from) variables in the called
function block
Input variables IN1 Passed to FB2_IN1.
IN2 Passed to FB2_IN2.
IN3 Passed to FB2_IN3.
Output variables OUT1 Received from FB2_OUT1.
OUT2 Received from FB2_OUT2.
OUT3 Received from FB2_OUT3.
Program
ST
Instance_ST
(ST)
Example) ...
Instance_FB(...,...);
INSTANCE_FB is an instance name of data t