Mitsubishi MELSEC Q Series Programming Manual page 416

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

DROR(P),DRCR(P)
DRCR
(1) Rotates 32-bit data, including carry flag, at device designated by
The carry flag goes ON or OFF depending on its status prior to the execution of the DRCR
instruction.
(2) When a bit device is designated for
specified by digit specification. The number of bits by which a rotation is executed is the
remainder of n /(specified number of bits).
For example, when n
1 is "7", and the data is rotated 7 bits.
(3) Specify any of 0 to 31 as n. If the value specified as n is 32 or greater, the remainder of n /
32 is used for rotation. For example, when n
right since the remainder of 34 / 32
Operation Error
(1) There are no operation errors associated with the DROR(P) or DRCR(P) instruction.
Program Example
(1) The following program rotates the contents of D0 and D1, not including the carry flag, 4 bits
to the right when XC is ON.
[Ladder Mode]
[Operation]
D0, D1 0
D0, D1 1
Contents of b3 to b0
before execution
7-42
D
+1
b31
b30 b29 b28 b27
b18
b17
n-bit rotation
31 and (specified number of bits)
b31
b28 b27
b24 b23
b20 b19
b16
0
0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
b31
b28 b27
b24b23
b20b19
b16
1
1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Contents of b31 to b4
before execution
D
b16
b15b14
b5 b4 b3
b2
, a rotation is performed within the device range
D
34, the contents are rotated two bits to the
1 is "2".
[List Mode]
Step
Instruction
b15
b12 b11
b8 b7
b4 b3
b0
b15
b12 b11
b8 b7
b4 b3
b0
n bits to the right.
D
Carry flag
(SM700)
b1 b0
24 bits, the remainder of 31/24
Device
Carry flag
(SM700)
0
Carry flag
(SM700)
1
Content of b3
before execution

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents