Bit-shift instructions
560
Part III FP Instructions
F101_SHL
Left shift of 16-bit data in bit units
000
·········
D
15 1211 8 7 4 3 0
·· ·· ·· ··
D
15 1211 8 7 4 3
0
0
n
1
2
Bit position
Bit position
When n bits are shifted to the left, the data in the nth bit
1
is transferred to special internal relay
R9009 (carry-flag) and n bits
2
starting with bit position 0 are filled with 0s.
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 F101_SHL (see page 1320)
Variable Data type Function
d ANY16 16-bit area to be shifted to the left
n INT number of bits to be shifted
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
Shifts n bits of 16-bit data area specified by d to the left (to the higher bit position) if the trigger EN
is in the ON-state.
Data types
Operands
Example
In this example, the same POU header is used for all programming languages. For an 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.
Body
When the variable start changes from FALSE to TRUE, the function is carried out.