7.5.2 SHL
Function
Move the operand input by IN to the left by N bits in binary digits, and fill the vacant bits on the right with zeros. Finally, the result is output in OUT
LD graphics
- The following figure illustrates how to shift the integer data type operand to the left by 3 bits:

Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN | Var_Input | ANY_BIT | Operand to shift left |
| N | Var_Input | ANY_INT | Number of bits to shift to the left |
| Function name | Return value | ANY_BIT | Value after left shift |
warning
- Here ANY_BIT data type is BYTE, WORD, DWORD, LWORD;
- BOOL has no meaning, the return value type is the same as IN type
Example
- LD example is shown below:

- ST example is shown in the following code:
wVar:=SHL(IN:=wVar,N:=nVar);