Bit-shift instructions
570
Part III FP Instructions
F108_BITR
Right shift of multiple bits of 16-bit data range
d2 d1
000
Specified data range
start: ON
n bits
n bits are
shifted out
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 F108_BITR (see page 1320)
Variable Data type Function
d1 starting 16-bit area
d2
ANY16
ending 16-bit area
n INT number of bits to be shifted
The addresses of the variables at inputs d1 and d2 have to have the same address type.
For Relay T/C Register Constant
d1, d2 - WY WR WL SV EV DT LD FL -
n WX WY WR WL SV EV DT LD FL dec. or hex.
No. IEC address Set If
R9007 %MX0.900.7 permanently
R9008 %MX0.900.8 for an instant
the address of the variables at the
outputs d1 > d2 or the value at input is n
16.
Description
The function shifts the bits of a specified data range, whose beginning and end are specified by the
outputs d1 and d2 to the right. The number of bits by which the data range is to be shifted to the
right is specified by the value assigned at input n. The value may lie between 0 and 16. Bits
cleared because of the shift become 0. When input n = 0, no shift takes place. When input n = 16,
a shift of one WORD occurs, i.e. the same process takes place as with function F110_WHSL (see
page 573).
Data types
Operands
Error flags