5 Understanding Programming
5-42
CJ2 CPU Unit Software User’s Manual
5-4 Function Blocks
A function block (FB) is a basic program element containing the programming for a standard processing
function that has been defined in advance. Once you have created function blocks and saved them in a
library, you can use them in programming simply by selecting the function blocks that are required for
the system, placing them in the program, and setting I/O parameters. Excellent function blocks can
greatly improve the efficiency of program development.
OMRON function blocks conform to IEC 61131-3.
z Features of Function Blocks
• Reusability
A function block can be saved in a library so that it can be easily reused. Once the programmer
understands the function blocks, the programmer can use them simply by setting parameters. This
greatly improves programming efficiency.
• Reduced Debugging Work
Reusing high-quality function blocks that have already been debugged eliminates the need to debug
them again and thereby reduces debugging work.
• Data Protection
The variables inside a function block cannot be accessed directly from the outside, so the data is pro-
tected. (Data will not be changed unintentionally.)
5-4-1 Function Blocks
FB
FB
FB
FB
FB
Once function blocks have been
created, they can be used in a
variety of programs.
Library
Program for Device A
Rack A
parameters
Program for Device A
Rack B
parameters
Simply set the parameters for
each of the devices.
Algorithms do not need to be
verified for function blocks that
are already completed.