Mitsubishi Electric MELSEC iQ-R-R00CPU User Manual page 358

Melsec iq-r series cpu module application user's manual
Table of Contents

Advertisement

Change of the index modification range due to switching from 16-bit to 32-bit
To change the index modification range for switching from 16-bit to 32-bit, the user must:
• Review the index modification block(s) within the program.
• To perform the 32-bit index modification specification with ZZ expression, review the range of the index register (Z). Note
that the range within the LZ cannot be specified.
• For 32-bit index modification with ZZ expression, because the specified index register (Zn) and the immediately following
index register (Zn+1) are used, caution must be taken to prevent duplicated index registers from being used.
• Review the number of points of the index register (Z) and that of the long index register (LZ), which are specified in "Index
Register Setting" ( Page 354 Index register setting)
When values are stored in the index registers
For 16-bit index modification using the index register (Z), the range is -32768 to 32767. Therefore, when values within the
range from 32768 to 65535 are stored in the index register (Z) for an instruction which processes unsigned data, the
instruction does not work in design because the range of the index modification will be -32768 to 32767. For the range of
values larger than or equal to 32768, the long index register (LZ) must be used so that 32-bit-based index modification can be
applied.
Ex.
Operation for Index modification
Device/label memory
D17231
D17232
(1)
D49999
D50000
D82767
D82768
D115535
(2)
(1) When unexpected operation is executed
SM400
+P_U K65535 Z0
MOV K100 D50000Z0
21 DEVICES
356
21.8 Index Register (Z/LZ)
-2147483648
-32768
Z0
LZ0
32767
2147483647
(2) When proper operation is executed
SM400
D+P_U K65535 LZ0
MOV K100 D50000LZ0
(1) When the value 65535 is stored in the index register (Z),
D50000(-1) to D49999 are accessed because the value is
turned into -1 when an index modification is performed.
(2) When a value larger than or equal to 32768 is used for an
index modification, the value must be stored in the long index
register (LZ). In doing so, the value 65535 is used as such for
an index modification using the long index register (LZ) and
D50000 (65535) to D115535 become accessible.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents