Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controllers Devices in Detail 4
4-39
4.13.1 Modifying a Constant
Constants can be modified
j
ust as easil
y
as data re
g
isters or bit devices. If, for example, the
constant K20 was actuall
y
written K20V the final result would equal:
K20 + the contents of V
Example:
4.13.2 Misuse of the Modifiers
Modif
y
in
g
Kn devices when Kn forms part of a device description such as KnY is not possible,
i.e. while the followin
g
use of modifiers is permitted;
K3Z
K1M10V
Y20Z
Statements of the form:
K4ZY30
are not acceptable.
Modifiers cannot be used for parameters entered into an
y
of the 20 basic instructions,
i.e. LD, AND, OR etc.
4.13.3 Using Multiple Index Registers
The use of multiple index re
g
isters is
sometimes necessar
y
in lar
g
er pro
g
rams or
pro
g
rams which handle lar
g
e quantities of
data. There is no problem from the PLC’s
point of view in usin
g
both V and Z re
g
isters
man
y
times throu
g
h out a pro
g
ram. The point
to be aware of is that it is sometimes
confusin
g
for the user or a maintenance
person readin
g
such pro
g
rams, as it is not
alwa
y
s clear what the current value of V or Z
is.
Example:
V = 10 (K10)
Z = 20 (K20)
D5V = D15 (D5 + V = D5 + 10 = D15)
D15Z = D35 (D15 + Z = D15 + 20 = D35)
D40Z = D60 (D40 + Z = D40 + 20 = D60)
Both V and Z re
g
isters are initiall
y
set to K10 and K20 respectivel
y
.
The contents of D15 is added to that of D35 and store in D60.
V is then reset to 0 (zero) and both V and Z are used in the double word addition (DADD).
The contents of D1, D0 are then added to D3, D2 and then finall
y
stored in D25, D24.
If V = 3276 then K20V
K
20
V
(3276)
3296
X0
D40Z
X2
ADD D 5V
D 15Z
MOV K10 V
X1
MOV K20 Z
M8000
MOV K0 V
D 4Z
X3
DADD
D 0 D 2