Shift Lef (BOOL)
Instruction Parameters
Supported PLC Series
| XPnA/1R | XPnB | XPnE | XPnF | CP3A/B/P/U CP4A~D/U | CPnE | CPnF | BP | PLC-S |
|---|---|---|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| D | ✓ | - | ✓ | ✓ | ✓ | - | ✓ | ✓ | - | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| n | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | - |
| Carry | F11.2 | ✓ |
Number of Steps
| Steps |
|---|
| 3 |
Operands
| Operand | Description |
|---|---|
| D | The first operand. Entries are only BOOL data registers. This is the n-bit of data to be shifted right. The result of the shift is saved here. |
| n | The second operand. Entries are WORD data registers or constants. This is the number of bits to shift. The value range is 1 ~ the last data register of D. |
Notice
Error Flag (F11.0) Notice
The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.
F11.0 turns ON when the value of the data for a shift exceeds the data register assigned to D.
F11.0 turns ON when the value of n is greater than the amount of data registers D.
Carry Flag (F11.2) Notice
The carry flag, F11.2, will be ON for one scan when the operation result overflows.
Instruction Behavior
The BSFL and BSFLP instructions behave as follows:

- n-bit data is shifted to the left starting at the BOOL data register, D.
- Data is shifted 1 bit in the direction of the most significant bit.
- The value of n CANNOT exceed the size of the data register D.
- The data located in the data register D is shifted into the carry flag, F11.2.
- The carry flag turns ON when 1 is shifted into the carry flag, F11.2.
- The data register D + (n-1) is equal to 0.
- This occurs when the instruction is energized.
Execution Condition
It is recommended that the BSFL instructions be used with a pulse contact as an execution condition, or use the BSFLP instruction.