Fnc 32 - Rcr / Rotation Right With Carry - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
11.3
FNC 32 – RCR / Rotation Right with Carry
Outline
This instruction shifts and rotates the bit information rightward by the specified number of bits together with
the carry flag.
1. Instruction format
FNC 32
D
RCR
P
2. Set data
Operand Type
D
n
*1.
Do not set a negative value to the number of bits to be rotated.
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
D
n
: In 16-bit operations, K4Y
In 32-bit operations, K8Y
Explanation of function and operation
1. 16-bit operation (RCR and RCRP)
"n" bits out of 16 bits of
Command
input
FNC 32
RCRP
Before
execution
b2 (n−2) to b0 and the head bit
indicating the carry flag ON/OFF
status are moved.
After
execution
The carry flag is intervened in the rotation loop. If M8022 has been set to ON or OFF before the rotation
instruction, the carry flag is transferred to the destination.
Mnemonic
16-bit Instruction
RCR
5 steps
RCRP
Word device number storing data to be rotated rightward
Number of bits to be rotated
[n ≤ 16 (16-bit instruction), n ≤ 32 (32-bit instruction)]
Digit Specification
, K4M
, K8M
and 1 bit (carry flag M8022) are rotated rightward.
D
D
n
High order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1 1 1 1 1 1 1 1 0 0 0 0
After the
instruction
is
executed
once
Rightward
"n" bits
rotation
High order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0
Before
Before shift b15 to b4
shift
b2 to b0
Before shift
Carry flag M8022
11 Rotation and Shift Operation – FNC 30 to FNC 39
11.3 FNC 32 – RCR / Rotation Right with Carry
Operation Condition
32-bit Instruction
Continuous
9 steps
Operation
Pulse (Single)
Operation
Description
*1
Word Devices
Special
System User
Index
Unit
V Z Modify K H
and K4S
are valid.
and K8S
are valid.
"n" bits (in the case of K4)
Low order
Carry flag
M8022
0
0 0 0
1
b3 (n−1)
to b0 are
b3 (n−1)
moved.
Low order
0
Carry flag
M8022
Mnemonic
Operation Condition
Continuous
DRCR
Operation
Pulse (Single)
DRCRP
Operation
Data Type
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
stant
Number
ter String
E
" "
When M8022 is ON
The status of the final bit b3
(bit "n−1") is stored.
Before shift b3
11
12
13
14
15
Pointer
P
16
17
18
19
20
311

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents