ROR (rotate right)
The ROR instruction rotates the DINT type input by NbR bits to right in a circular form and fills the bits on the left 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.
ROR

ROR

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
|
IN | Input | DINT | Any integer value. |
NbR | Input | DINT | Number of 1-bit rotations (in set [1..31]). |
ROR | Output | DINT | Right rotated value. There is no effect if NbR <= 0. |
ENO | Output | BOOL | Enables output. Applies to ladder diagram programs. |
ROR examples
ROR function block diagram example

ROR ladder diagram example

ROR structured text example

(* ST Equivalence: *) result := ROR (register, 1); (* register = 2#0100_1101_0011_0101 *) (* result = 2#1010_0110_1001_1010 *)
Results

Provide Feedback