5 Outline of Motion Control Systems
5.3.3 Using i and j Subscripts
5-26
5.3.3 Using i and j Subscripts
There are two special register modifiers, i and j, that can be used with relay and register numbers. The functions of i
and j are exactly the same. They are used for handling register numbers as variables.
Examples of each register data type are used to explain the use of i and j.
( 1 ) Bit Registers with Subscripts
( 2 ) Integer Registers with Subscripts
( 3 ) Double-length Integers and Real Numbers with Subscripts
Example Program Using Subscripts
Equivalent
These are the same as when i or j values
are added to relay numbers.
For example, when i = 2, MB000000i is
the same as MB000002. And when j =
27, MB000000j is the same as
MB00001B.
Equivalent
These are the same as when i or j values
are added to register numbers.
For example, when i = 3, MW00010i is
the same as MW00013. And when j =
30, MW00001j is the same as
MW00031.
MW00001
MW00002
MW00000
MW00001
MW00001
MW00002
MW00000
MW00001
ML00000j when j = 0: ML00000
ML00000j when j = 1: ML00001
Upper word
Double-length Integer Type
Lower word
MF00000j when j = 0: MF00000
MF00000j when j = 1: MF00001
Upper word
Real Number Type
Lower word
These are the same as when i or j values are added
to register numbers. For example, when j = 1,
ML00000j is the same as ML00001. And when j =
1, MF00000j is the same as MF00001. For double-
length integers and real numbers, the word thet
indicates a register is the lower word. Caution is
required because this means that ML00001 and
MF00001 will be different when j = 0 and when j
=1 because the upper and lower words will differ
as shown in the following example.
The program shown to the left finds the total of
100 registers from MW00100 to MW00199, using
subscript j, and writes the total to MW00200.