Function Blocks; Overview Of Function Blocks; Advantages Of Function Blocks - Omron CP1H-X40D Operation Manual

Cpu unit sysmac cp series
Hide thumbs Also See for CP1H-X40D:
Table of Contents

Advertisement

Function Blocks

1-5

Function Blocks

1-5-1

Overview of Function Blocks

Standard program
section written
with variables
aa
cc
bb
MOV
#0000
dd
1-5-2

Advantages of Function Blocks

Structured
Programming
40
In the SYSMAC CP Series, function blocks can be used in programming just
as in the CS/CJ Series.
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.
As a standard processing function, a function block is not created with actual
physical addresses, but local variables. The user sets parameters (addresses
or values) in those variables to use the function block. The addresses used for
the variables themselves are automatically assigned by the system (CX-Pro-
grammer) each time they are placed in the program.
In particular, each function block is saved by the CX-Programmer as an indi-
vidual file that can be reused with programs for other PLCs. This makes it pos-
sible to create a library of standard processing functions.
Function block A
Program 1
Define in advance.
Insert in program.
Save function
block as file.
Library
Function
block A
To another PLC program
Reuse
Function blocks allow complex programming units to be reused easily. Once
standard program sections have been created as function blocks and saved in
files, they can be reused just by placing a function block in a program and set-
ting the parameters for the function block's I/O. Reusing standardized function
blocks reduces the time required for programming/debugging, reduces coding
errors, and makes programs easier to understand.
Structured programs created with function blocks have better design quality
and required less development time.
Program 2
Copy of function block A
Input
Output
Variable
Variable
Setting
Setting
Copy of function block A
Input
Output
Variable
Variable
Section 1-5
Copy of function block A
Output
Variable

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cp1h-xa40dCp1h-y20dt-dCp1h

Table of Contents