EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Page 27

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
12
Function Blocks Section 1-2
If internal variables are not used, if processing will not be affected, or if the
internal variables are used in other locations, the same instance name can be
used at multiple locations in the program.
Some precautions are required when using the same memory area. For
example, if the same instance containing a timer instruction is used in more
than one program location, the same timer number will be used causing coil
duplication, and the timer will not function properly if both instructions are exe-
cuted.
Registration of Instances Each instance name is registered in the global symbol table as a file name.
P_On
1.0
&10
CONTROL
EN ENO
ON_TIME
OFF_TIME
&20
CASCADE_01
P_On
1.1
&10
CONTROL
EN ENO
ON_TIME
OFF_TIME
&15
CASCADE_02
P_On
1.2
&8
CONTROL
EN ENO
ON_TIME
OFF_TIME
&7
CASCADE_03
Function Block Definition
Example: CONTROL
Algorithm
Variables
Instance
CASCADE_02
Algorithm
Internal and I/O
variables
Instance
CASCADE_01
Algorithm
Internal and I/O
variables
Instance
CASCADE_03
Algorithm
Internal and I/O
variables
Cyclic task 0
Cyclic task 1
Example:
There are 3 FB
instances and each
has its own I/O and
internal variables.
P_On
1.0
&130
CONTROL
EN ENO
PARA_1
PARA_2
&100
CASCADE
P_On
1.1
&150
CONTROL
EN ENO
PARA_1
PARA_2
&50
CASCADE
P_On
1.2
&200
CONTROL
EN ENO
PARA_1
PARA_2
&100
CASCADE
Function block definition
Example: CONTROL
Algorithm
Variables
Instance
CASCADE
Algorithm
Internal and I/O
variables
Cyclic task 0
Cyclic task 1
The same instance can be
used at multiple locations.
ab
c
sample FB [FunctionBlock1] N/A[Auto]
Program
Instance (sample) of function block definition A
The instance is registered in the
global symbol table with the instance
name as the symbol name.
Name
Data type
Address/
value
The function block definition
name is registered after FB in
square parentheses [ ].
Instance name

Table of Contents

Related product manuals