SHL (shift left)

For 32-bit integers, the SHL instruction moves integers to the left and places 0 in the least significant bit.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
SHL
SHL
SHL
SHL parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
When set to true, the instruction is enabled.
  • TRUE: Execute the current computation.
  • FALSE: There is no computation.
Applies to ladder diagram programs.
IN
Input
DINT
Any integer value.
NbS
Input
DINT
Number of 1 bit shifts (in set [1..31]).
SHL
Output
DINT
Left shifted value. There is no effect if NbS <= 0. If a value of 0, replaces the least significant bit.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

SHL examples

SHL function block diagram example
SHL function block diagram example
SHL ladder diagram example
SHL ladder diagram example
SHL structured text example
SHL structured text example
(* ST Equivalence: *) result := SHL (register,1); (* register = 2#0100_1101_0011_0101 *) (* result = 2#1001_1010_0110_1010 *)
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal