Omron WS02-CXPC1-V9 - V9 Operation Manual page 92

Table of Contents

Advertisement

Precautions for Instructions with Operands Specifying the First or Last of Multiple Words
Non-array Variables
without Matching Data
Size and without AT
Setting
Example: XFER
(variables a and b are WORD data types)
Internally allocated address
Example: H700
66
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.
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
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.
&10
a
b
Example: H7@@
Variable a (1 word)
10 words are
transferred regard-
less of the size of
variable a.
Internally allocated address
Variable b (1 word)
Section 2-6
&10 a
This area will be overwritten,
so the CX-Programmer will
output a compile error.
b

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents