![Omron CX-PROGRAMMER V8.1 Operation Manual Download Page 43](http://html1.mh-extra.com/html/omron/cx-programmer-v8-1/cx-programmer-v8-1_operation-manual_744203043.webp)
18
Variables
Section 1-3
Registration of Instances
Each instance name is registered in the global symbol table as a file name.
1-3
Variables
1-3-1
Introduction
In a function block, the addresses (see note) are not entered as real I/O mem-
ory addresses, they are all entered as variable names. Each time an instance
is created, the actual addresses used by the variable are allocated automati-
cally in the specified I/O memory areas by the CX-Programmer. Conse-
quently, it isn’t necessary for the user to know the real I/O memory addresses
used in the function block, just as it isn’t necessary to know the actual mem-
ory allocations in a computer. A function block differs from a subroutine in this
respect, i.e., the function block uses variables and the addresses are like
“black boxes.”
Example:
Note
Constants are not registered as variables. Enter constants directly in instruc-
tion operands.
a
b
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
a
b
c
MOV
a
c
b
Name Type
AT
Initial Value
Retained
a
BOOL
c
BOOL
Name Type
AT
Initial Value
Retained
b
BOOL
0.00
a
1
1
3.00
c
0
0
2.00
b
1
1
Input 0.00
Instance of function block definition A
Input 3.00
Output 2.00
Function block definition A
Standard program section with
variable names a, b, c, etc.
Insert in
program.
Specify inputs and outputs
at the same time.
Table indicating usage and
properties of variables a, b, c, etc.
Usage: Inputs
Properties:
Usage: Outputs
Properties:
Status of 0.00 (1 or 0) is
passed to a.
Status of b (1 or 0) is
passed to 2.00.
Status of 3.00 (1 or 0) is
passed to c.
Program
The system automatically allocates the
addresses used by variables a, b, and c. For
example, when W100 to W120 is set as the
system’s non-retained memory area, bit
addresses such as a = W10000, b = W10001,
and c = W10002 will be allocated.
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......