Panasonic FP Series Programming Manual page 599

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Bit-shift instructions
F127_DRCR
The function rotates the value at output d via the carry flag to the right. The number of bits at output
Description
d to be rotated to the right is specified by the value assigned at input n. This shift can lie between 0
and 255 (only the lower value byte of n is effective).
The bit value at bit position n - 1 is stored in the carry flag. The function shifts out n bits from bit 0
to the right, and then along with the inverted carry flag first, continues via bit 31 into the higher bit
positions. Position 32 - n now has the inverted value of the carry flag.
When input n = 0, no rotation occurs and the carry flag remains unchanged.
When at input n > 32, the same result is achieved as with a number n < 32: e.g. n = 33 produces
the same result as when n = 0; n = 34 the same as n = 1.
31
data
1 0 1 0
Carry
1
flag
@
data
0 1 1 1
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.
Availability of F127_DRCR (see page 1321)
PLC types
Data types
Variable
Data type
ANY32
d
INT
n
Operands
For
d
WX
n
Error flags
No.
IEC address
%MX0.900.9
R9009
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
598
32-bit data right rotate with carry flag data
· · ·
28 27
8 7
4 3
1 1 0 0
0
0 1 1
1 0 1 0
1 1 0 0
Function
32-bit data area
number of bits to be rotated (range: 0 to 255)
Relay
-
DWY
DWR
DWL
DSV
WY
WR
WL
Set
for an instant
0
@
start: ON
Carry flag
0
T/C
Register
DEV
DDT
DLD
DFL
SV
EV
DT
LD
FL
If
 the bit at position n - 1 has the value 1.
Constant
-
dec. or hex.

Advertisement

Table of Contents
loading

Table of Contents