Bit-shift instructions
574
Part III FP Instructions
F110_WSHR
Right shift of one word (16 bits) of 16-bit data range
When one word (16 bits) is shifted to the right, the starting word is shifted out and the data in the
ending word becomes 0.
D2
0
D1
D2 D1
Specified data range
The data in the ending
word becomes 0
The starting word is
shifted out
d1 and d2 should be:
the same type of operand
d1 d2
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 F110_WSHR (see page 1320)
Variable Data type Function
d1 starting 16-bit area
d2
ANY16
ending 16-bit area
The variables d1 and d2 have to be of the same data type.
For Relay T/C Register Constant
d1, d2 - WY WR WL SV EV DT LD FL -
Description
Shifts one word (16 bits) of the data range specified by d1 (starting) and d2 (ending) to the right (to
the lower word address) if the trigger EN is in the ON-state.
Data types
Operands
Example
In this example the function has been programmed in ladder diagram (LD) and structured text
(ST).The same POU header is used for all programming languages.