![Omron CX-PROGRAMMER V8.1 Operation Manual Download Page 91](http://html1.mh-extra.com/html/omron/cx-programmer-v8-1/cx-programmer-v8-1_operation-manual_744203091.webp)
66
Precautions for Instructions with Operands Specifying the First or Last of Multiple Words
Section 2-6
Size to Be Processed in the Instruction Operand Is Fixed
Make sure that the number of elements in the array is the same as size to be
processed by the instruction. Otherwise, the CX-Programmer will output an
error when compiling.
Size to Be Processed in the Instruction Operand Is Not Fixed
Make sure that the number of elements in the array is the same or greater
than the size specified by another operand.
Other Operand Specifying Size: Constant
The CX-Programmer outputs an error when compiling.
Other Operand Specifying Size: Variable
The CX-Programmer will not output an error when compiling (a warning mes-
sage will be displayed) even if the number of elements in the array does not
match the size specified in another operand (variable).
In particular, when the number of elements in the array is less than the size
specified by another operand, (for example, when instruction processing size
is 16 and the number of elements actually registered in the variable table is
10), the instruction will execute read/write processing in the areas exceeding
the number of elements. (In this example, read/write processing will be exe-
cuted for the next 6 words after the number of elements registered in the
actual variable table.) If the same area is being used by another instruction
(including internal variable allocations), unexpected operation may occur,
which may result in a serious accident.
Do not use variables with a size that does not match the data size to be pro-
cessed by the instruction in the operand specifying the first address (or last
address) for a range of words. Always use either non-array variables data type
with a size that is the same as the data size required by the instruction or
array variable with the number of elements that is the same as the data size
required by the instruction. Otherwise, the following errors will occur.
Non-array Variables
without Matching Data
Size and without AT
Setting
If the operand specifying the first address (or last address) of multiple words
uses a non-array variable data type with a size that does not match the data
size required by the instruction and an AT setting is also not used, the CX-Pro-
grammer will output a compile error.
Example: BLOCK TRANSFER(070) instruction: XFER W S D
(W: Number of words, S: First source word; D: First destination word)
When
&10
is specified in W, variable
a
with data type WORD is specified in S,
and variable
b
with data type WORD is specified in D: XFER
&10 a
b
The XFER(070) instruction will transfer the data in the 10 words beginning from
the automatically allocated address in variable
a
to the 10 words beginning
with the automatically allocated address in variable
b
. Therefore, the CX-Pro-
grammer will output a compile error.
Example: XFER &10
a
b
(variables a and b are WORD data types)
Internally allocated address
Internally allocated address
Example: H700
Example: H7
@@
Variable b (1 word)
Variable a (1 word)
10 words are
transferred regard-
less of the size of
variable a.
This area will be overwritten,
so the CX-Programmer will
output a compile error.
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: ......