270
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
11 Rotation and Shift Operation – FNC 30 to FNC 39
11.1 FNC 30 – ROR / Rotation Right
2. 32-bit operation (DROR and DRORP)
"n" bits out of 32 bits of [
+1,
] are rotated rightward.
• The final bit is stored in the carry flag (M8022).
• In a device with digit specification, K8 (32-bit instruction) is valid.
Related device
→
For the carry flag use method, refer to Subsection 6.5.2.
Cautions
1. In the case of continuous operation type instructions (ROR and DROR)
Note that shift and rotation are executed in every scan time (operation cycle).
2. When a device with digit specification is specified as
Only K4 (16-bit instruction) or K8 (32-bit instruction) is valid (examples: K4Y010 or K8M0).
Device
Name
Description
M8022
Carry
Turns ON when the bit shifted last from the lowest position is "1".
D
D
Command
input
FNC 30
DRORP
n
D
0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
0
Carry flag
M8022
Low order
Carry flag
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Before shift
b3 to b0
After the
instruction is
executed once
High order
0
0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
Before shift
b31 to b4
High order
1 1 1 1 1 1 1 1 0 0 0 0
0
0 0 0
Low order
M8022
Rightward
rotation
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
b31b30b29b28b27b26b25b24b23b22b21b20b19b18b17b16
The contents of
b3 are stored.
"n" bits (in the case of K4)
The status of
the bit "n
−
1" is
copied.
b0 to b3 (n
−
1)
are moved.
"n" bits
The status of the bit "n
−
1" is
copied.
Before
execution
After
execution
D