7.1 User Program Types and Execution Timing
7.1.5 Registers
7
Cr
eating U
s
er Pr
ogram
s
7-35
Index Registers (i, j)
There are two special registers, i and j, that are used to modify relay and register addresses.
The functions of i and j are identical. They are used to handle register addresses in registers.
The indices i and j can be expressed in decimal when specified as variables.
We will describe this with examples for each register data type.
Attaching an Index to a Bit Register
Using an index is the same as adding the value of i or j to the register address.
For example, if i = 2, MB00000000i is the same as MB00000002.
Attaching an Index to an Integer Register
Using an index is the same as adding the value of i or j to the register address.
For example, if j = 30, MW0000001j is the same as MW0000031.
The data is little endian, as shown in the following example.
•
MB00001006
•
MW0000100 = 1234h
•
ML0000100 = 12345678h
•
MQ0000100 = 123456789ABCDEF0h
Information
F
E
D
C
B
A
9
8
7
6
5
4
3
2
1
0
Bit
MB00001006
MW0000100
MW0000100
12
3
4h
ML0000100
MW0000100
MW0000101
12
3
4h
5678h
MQ0000100
MW0000100
MW0000101
MW0000102
MW000010
3
12
3
4h
5678h
9ABCh
DEF0h
Equivalent
i =
2;
DB000000
=
MB00000000i;
DB000000
=
MB00000002;
Equivalent
DW00000
=
MW0000031;
DW00000
=
MW0000001j;
j =
30;