12
Function Blocks
Section 1-2
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.
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.
Structured
Programming
Structured programs created with function blocks have better design quality
and require less development time.
Easy-to-read “Black Box”
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.
Use One Function Block
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).
Reduce Coding Errors
Coding mistakes can be reduced because blocks that have already been
debugged can be reused.
Black-boxing Know-how
Read-protection can be set for function blocks to prevent programming know-
how from being disclosed.
Data Protection
The variables in the function block cannot be accessed directly from the out-
side, so the data can be protected. (Data cannot be changed unintentionally.)
Improved Reusability with
Variable Programming
The function block’s I/O is entered as variables, so it isn’t necessary to change
data addresses in a block when reusing it.
Creating Libraries
Processes that are independent and reusable (such as processes for individ-
ual steps, machinery, equipment, or control systems) can be saved as func-
tion block definitions and converted to library functions.
Input
Output
Input
Output
Output
Function block A
Save function
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.
Function
block A
Define in advance.
Insert in
program.
Reuse.
To another PLC program
Variable
Variable Variable
Set
Set
Variable
Variable
Program 1
Standard
program section
written with
variables
Содержание CX-PROGRAMMER V8.1
Страница 3: ...iv...
Страница 5: ...vi...
Страница 7: ......
Страница 15: ...xvi...
Страница 19: ...xx...
Страница 25: ...xxvi Application Precautions 4...
Страница 26: ...Part 1 Function Blocks...
Страница 27: ......
Страница 153: ...128 Procedures Section 3 2...
Страница 154: ...Part 2 Structured Text ST...
Страница 155: ......
Страница 159: ...134 CX Programmer Specifications Section 4 2...
Страница 205: ...180 Procedures Section 6 1...
Страница 207: ...182 System defined external variables supported in function blocks Appendix A...
Страница 229: ...204 Revision History...
Страница 230: ......