Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION Operation Manual page 24

Function blocks
Table of Contents

Advertisement

Function Blocks
Number of Function Block
Definitions
Instances
Note
2. Variable Definitions
The variable table lists each variable's usage (input, output, or internal) and
properties (data type, etc.). For details, refer to 1-3 Variables.
The maximum number of function block definitions that can be created for one
CPU Unit is either 128 or 1,024 depending on the CPU Unit model.
To use an actual function block definition in a program, create a copy of the
function block diagram and insert it in the program. Each function block defini-
tion that is inserted in the program is called an "instance" or "function block
instance." Each instance is assigned an identifier called an "instance name."
By generating instances, a single function block definition can be used to pro-
cess different I/O data with the same function.
Not yet in program
and memory not yet
allocated
(abstract).
Program
Function Block Definition FB1
Instance FB1_1 of function block definition FB1
1. Algorithm
Insert in
program.
Standard
program unit
with variable
names a, b, c,
etc.
2. Parameters
Insert in
Table defining usage
program.
and properties of
variables a, b, c, etc.
Instance FB1_2 of function block definition FB1
Instances are managed by names. More than one instance with the same
name can also be inserted in the program. If two or more instances have the
same name, they will use the same internal variables. Instances with different
names will have different internal variables.
For example, consider multiple function blocks that use a timer as an internal
variable. In this case all instances will have to be given different names. If
more than one instance uses the same name, the same timer would be used
in multiple locations, resulting in duplicated use of the timer.
If, however, internal variables are not used or they are used only temporarily
and initialized the next time an instance is executed, the same instance name
can be used to save memory.
Block instance in program with memory
allocated. (object)
Instance
Input
a
b
Output data
data
c
Output data
Input
a
b
Output data
data
c
Output data
Section 1-2
Memory
used
Automatic
allocation
Memory
for FB1_1
Memory
Automatic
for FB1_2
allocation
Different I/O data
can be processed
with the same
function.
9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-programmer 5.0Sysmac ws02-cxpc1-e-v50Cs1-hCj1-hCj1m

Table of Contents