![background image](http://html.mh-extra.com/html/omron/sysmac-cp-series/sysmac-cp-series_user-manual_742262053.webp)
4-9
4 Understanding Programming
CP2E CPU Unit Software User’s Manual(W614)
4-
3 Fu
nct
ion B
loc
ks
4
4-
3
-2 Adv
antages of Fu
nction Bloc
ks
Structured programs created with function blocks have better design quality and required less devel-
opment time.
z
Easy-to-read “Block Box” Design
The I/O operands are displayed as local variable names in the program, so the program is like a
“black box” when entering or reading the program and no extra time is wasted trying to understand
the internal algorithm.
z
Different Processes Easily Created from a Single Function Block
Many different processes can be created easily from a single function block by using input variables
for the parameters (such as timer SVs, control constants, speed settings, and travel distances) in the
standard process.
z
Reduced Coding Errors
Coding mistakes can be reduced, because blocks that have already been debugged can be reused.
z
Data Protection
The local variables in the function block cannot be accessed directly from the outside, so the data
can be protected. (Data cannot be changed unintentionally.)
z
Improved Reusability through Programming with Variables
The function block
’
s I/O is entered as local variables, so the data addresses in the function block do
not have to be changed as they do when copying and reusing a program section.
Processes that are independent and reusable (such as processes for individual steps, machinery,
equipment, or control systems) can be saved as function block definitions and converted to library
functions.
The function blocks are created with local variable names that are not tied to physical addresses, so
new programs can be developed easily just by reading the definitions from the file and placing them
in a new program.
Mathematical expressions can be entered in structured text (ST) language.
Nesting function blocks is supported. For example, it is possible to express only special operations
in ST language within a function block in a ladder diagram.
For details on using function blocks, refer to the
CX-Programmer Ver. 7.0 Operation Manual: Func-
tion Block
s
(Cat. No. W447).
Structured Programming
Creating Libraries
Nesting Multiple Languages
F
u
nction
b
lock (ladder lang
u
age)
Call (
N
esting)
F
u
nction
b
lock (ST lang
u
age)
Содержание SYSMAC CP Series
Страница 1: ...USER S MANUAL Cat No W614 E1 01 SYSMAC CP Series CP2E E D CP2E S D CP2E N D CP2E CPU Unit Software ...
Страница 3: ......
Страница 32: ...1 Overview 1 4 CP2E CPU Unit Software User s Manual W614 ...
Страница 44: ...3 CPU Unit Operation 3 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 116: ...6 I O Allocation 6 8 CP2E CPU Unit Software User s Manual W614 ...
Страница 144: ...7 PLC Setup 7 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 170: ...10 Interrupts 10 14 CP2E CPU Unit Software User s Manual W614 ...
Страница 200: ...11 High speed Counters 11 30 CP2E CPU Unit Software User s Manual W614 ...
Страница 272: ...12 Pulse Outputs 12 72 CP2E CPU Unit Software User s Manual W614 ...
Страница 278: ...13 PWM Outputs 13 6 CP2E CPU Unit Software User s Manual W614 ...
Страница 460: ...18 Programming Device Operations 18 28 CP2E CPU Unit Software User s Manual W614 ...
Страница 576: ...Revision 2 CP2E CPU Unit Software User s Manual W614 ...
Страница 577: ......