16
3 PROGRAM ORGANIZATION UNIT (POU)
3.2 Function Block (FB)
3.2 Function Block (FB)
Function blocks are a type of POU used by program blocks or other function blocks.
Unlike the function, the function block does not output return values.
The function block can save a value in a variable, and thus the input status and processing result are retained.
Because the retained value is used for the next processing, the same result is not always output even with the same input
value.
To use the function block in a program, instances must be defined.
Page 17 Instances
Input variable, output variable, and input/output variable
Input variables, output variables, and input/output variables must be defined for function blocks.
The function block can output multiple operation results and can also be created without any output.
For classes for which input variables, output variables, or input/output variables can be set, refer to the following.
Page 23 Class
Case of ladder diagram Case of FBD/LD language
(1) Instance name
(2) Function block name
(3) Output variables
(4) Input variables
(1) Multiple outputs are returned.
(2) No outputs are returned.
FB
FBFB
Function blockFunction block
Function block Function block
(2)
(1)
(4)
(3)
_S1 Q1
RESET
IN_Bool
iTim
lCnt
CD Q
CVLOAD
PV
InstanceInstance
Instance
SR SAMPLE_FB1
CTD
(1)
(2)