Panasonic FP Series Programming Manual page 587

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Bit-shift instructions
F120_ROR
Rotates n bits of the 16-bit data specified by d to the right if the trigger EN is in the ON-state.
Description
The following example rotates one bit to the right:
Bit position
15
D
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Bit position
15
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
D
Special internal relay
R9009 (carry flag)
When n bits are rotated to the right,
the data in bit position n-1 (nth bit starting from bit position 0) is transferred to the
special internal relay R9009 (carry-flag).
n bits starting from bit position 0 are shifted out to the right and 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.
Availability of F120_ROR (see page 1320)
PLC types
Data types
Variable
Data type
ANY16
d
INT
n
Operands
For
d
n
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.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
586
16-bit data right rotate
12 11
8 7
4 3
· · ·
· ·
· ·
· ·
1211
8 7
4 3
· ·
· ·
· ·
· ·
Data in bit position 0
1
Function
16-bit area
number of bits to be rotated
Relay
-
WY
WR
WL
WX
WY
WR
WL
0
0
0
T/C
Register
SV
EV
DT
LD
FL
SV
EV
DT
LD
FL
Constant
-
dec. or hex.

Advertisement

Table of Contents
loading

Table of Contents