Bit-shift instructions
590
Part III FP Instructions
F122_RCR
16-bit data right rotate with carry-flag data
This example rotates one bit to the right:
·········
D
15 1211 8 7 4 3 0
·········
D
15 1211 8 7 4 3 0
1
000101010101 0101
0101 01010101 0101
Bit position
Bit position
Special internal relay
R9009 (carry flag)
Carry flag data “0”
When n bits with carry-flag data are rotated to the right,
the data in bit position n-1 (nth bit starting from bit position 0) are transferred to
special internal relay R9009 (carry-flag).
n bits starting from bit position 0 are shifted out to the right and carry-flag data
and n-1 bits starting from bit position 0 are subsequently shifted into the higher
bit positions of the 16-bit data specified by d.
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types
Availability of F122_RCR (see page 1320)
Variable Data type Function
d ANY16 16-bit area
n INT number of bits to be rotated
For Relay T/C Register Constant
d - WY WR WL SV EV DT LD FL -
n WX WY WR WL SV EV DT LD FL dec. or hex.
Description
Rotates n bits of the 16-bit data specified by d including the data of carry-flag to the right if the
trigger EN is in the ON-state.
Data types
Operands