Download  Print this page

Moving Groups Of Bit Devices - Mitsubishi Electric FX2N Beginners Manual

Hide thumbs

Advertisement

Instructions for Moving Data
5.2.2

Moving groups of bit devices

The previous section showed how you can use the MOV instruction to write constants or the
contents of data registers to other data registers. Consecutive sequences of relays and other
bit devices can also be used to store numerical values, and you can copy them as groups with
applied instructions. To do this you prefixing a "K" factor to the address of the first bit device,
specifying the number of devices you want to copy with the operation.
Bit devices are counted in groups of 4, so the K factor specifies the number of these groups of
4. K1 = 4 devices, K2 = 8 devices, K3 = 12 devices and so on.
For example, K2M0 specifies the 8 relays from M0 through M7. The supported range is K1 (4
devices) to K8 (32 devices).
Examples for addressing groups of bit devices:
K1X0:
K2X4:
K4M16: 16 relays, start at 16
K3Y0:
K8M0: 32 relays, start at M0
Addressing multiple bit devices with a single instruction makes programming quicker and pro-
duces more compact programs. The following two examples both transfer the signal states of
relays M0 – M3 to outputs Y10 – Y13:
M8000
If the destination range is smaller than the source range the excess bits are simply ignored
(see the following illustration, top example). If the destination is larger than the source "0" is
written to the excess devices. Note that when this happens the result is always positive
because bit 15 is interpreted as the sign bit (lower example in the following illustration).
Bit 15
0
Sign bit (0: positive, 1: negative)
M15
M14 M13
Sign bit (0: positive, 1: negative)
0
Bit 15
5 – 10
4 inputs, start at X0
8 inputs, start at X4
12 outputs, start at Y0
MOV K1M0 K1Y010
1
0
1
0
1
These relays will not be changed
M12 M11 M10
0
0
0
0
0
(X0 to X3)
(X4 to X13, octal notation)
(M16 to M31)
(Y0 to Y13, octal notation)
(M0 to M31)
M0
M1
M2
M3
0
1
0
1
MOV D0 K2 M0
0
1
M9
M8
M7
M6
M5
MOV K2 M0 D1
0
0
0
1
More Advanced Programming
Y010
Y011
Y012
Y013
0
1
0
1
0
0
1
0
1
0
M4
M3
M2
M1
0
1
0
1
0
MITSUBISHI ELECTRIC
Bit 0
1
1
M0
1
Bit 0

Advertisement

Table of Contents

   Also See for Mitsubishi Electric FX2N

Comments to this Manuals

Symbols: 0
Latest comments: