ROL (rotate left)

The ROL instruction rotates the DINT type input by NbR bits to the left in a circular form and fills the bits on the right with the bits that are rotated.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
ROL
ROL
ROL
ROL 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
Integer value.
NbR
Input
DINT
Number of 1-bit rotations (in set [1..31]).
ROL
Output
DINT
Left rotated value. When NbR <= 0, no change occurs.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

ROL examples

ROL function block diagram example
ROL function block diagram example
ROL ladder diagram example
ROL ladder diagram example
ROL structured text example
ROL structured text example
(* ST Equivalence: *) result := ROL (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