Omron cx-programmer 5.0-function block operation 사용자 설명서
7
Function Blocks
Section 1-2
1-2
Function Blocks
1-2-1
Outline
A function block is a basic program element containing a standard processing
function that has been defined in advance. Once the function block has been
defined, the user just has to insert the function block in the program and set
the I/O in order to use the function.
function that has been defined in advance. Once the function block has been
defined, the user just has to insert the function block in the program and set
the I/O in order to use the function.
As a standard processing function, a function block does not contain actual
addresses, but variables. The user sets addresses or constants in those vari-
ables. These address or constants are called parameters. The addresses
used by the variables themselves are allocated automatically by the CX-Pro-
grammer for each program.
addresses, but variables. The user sets addresses or constants in those vari-
ables. These address or constants are called parameters. The addresses
used by the variables themselves are allocated automatically by the CX-Pro-
grammer for each program.
With the CX-Programmer, a single function block can be saved as a single file
and reused in other PLC programs, so standard processing functions can be
made into libraries.
and reused in other PLC programs, so standard processing functions can be
made into libraries.
1-2-2
Advantages of Function Blocks
Function blocks allow complex programming units to be reused easily. Once
standard programming is created in a function block and saved in a file, it can
be reused just by placing the function block in a program and setting the
parameters for the function block’s I/O. The ability to reuse existing function
blocks will save significant time when creating/debugging programs, reduce
coding errors, and make the program easier to understand.
standard programming is created in a function block and saved in a file, it can
be reused just by placing the function block in a program and setting the
parameters for the function block’s I/O. The ability to reuse existing function
blocks will save significant time when creating/debugging programs, reduce
coding errors, and make the program easier to understand.
Structured
Programming
Programming
Structured programs created with function blocks have better design quality
and require less development time.
and require less development time.
Easy-to-read “Black Box”
Design
Design
The I/O operands are displayed as variable names in the program, so the pro-
gram is like a “black box” when entering or reading the program and no extra
time is wasted trying to understand the internal algorithm.
gram is like a “black box” when entering or reading the program and no extra
time is wasted trying to understand the internal algorithm.
Use One Function Block
for Multiple Processes
for Multiple Processes
Many different processes can be created easily from a single function block by
using the parameters in the standard process as input variables (such as
timer SVs, control constants, speed settings, and travel distances).
using the parameters in the standard process as input variables (such as
timer SVs, control constants, speed settings, and travel distances).
Input
Output
Input
Output
Output
Function block A
Save function
block as a file.
block as a file.
Program 2
Copy of function block A
Copy of function block A
Copy of function block A
Convert to
library function.
library function.
Function
block A
block A
Define in advance.
Insert in
program.
program.
Reuse.
To another PLC program
Variable
Variable Variable
Set
Set
Variable
Variable
Program 1
Standard
program section
written with
variables
program section
written with
variables