Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controllers
Devices in Detail 4
4-39
4.13.1
Modifying a Constant
Constants can be modified just as easily as data registers or bit devices. If, for example, the
constant K20 was actually written K20V the final result would equal: 
K20 + the contents of V
Example: 
4.13.2
Misuse of the Modifiers
Modifying Kn devices when Kn forms part of a device description such as KnY is not possible,
i.e. while the following use of modifiers is permitted;
K3Z
K1M10V
Y20Z
Statements of the form:
K4ZY30
are not acceptable.
Modifiers cannot be used for parameters entered into any of the 20 basic instructions, 
i.e. LD, AND, OR etc.
4.13.3
Using Multiple Index Registers
T h e   u s e   o f   m u l t i p l e   i n d e x   r e g i s t e r s   i s
sometimes necessary in larger programs or
programs which handle large quantities of
data. There is no problem from the PLC’s
point of view in using both V and Z registers
many times through out a program. The point
t o   b e   a w a r e   o f   i s   t h a t   i t   i s   s o m e t i m e s
confusing for the user or a maintenance
person reading such programs, as it is not
always 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 registers are initially set to K10 and K20 respectively.
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 finally 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