ROR block

Short summary

Name

ROR

→POU type

→function

Category

IEC-block, Bitstring

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/error.svg currently restricted
(IEC demands ANY_INT for the input N.)

Graphical interface

images/download/thumbnails/414780772/ROR-version-1-modificationdate-1534860777948-api-v2.png

Available since

version 1.18.0 (for logi.CAD 3)

Functionality

The block returns the result of a bitwise rotation to the right (circular) .

At input IN, enter the value to be rotated. At input N, enter the bits to right-rotate the value. The bits cleared on the one side are filled in on the other side.

Inputs, return value


Identifier

→Data type

Description

Inputs:

IN

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)

input value

N

INT

number of bits to rotate

Return value:

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)


Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

PROGRAM Test
VAR
result1 : BYTE;
result2 : WORD;
END_VAR
result1 := ROR(IN := BYTE#16#42, N := 2); (* The variable 'result1' evaluates to '16#90' (decimal: 144). *)
result2 := ROR(IN := WORD#16#42, N := 2); (* The variable 'result2' evaluates to '16#8010' (decimal: 32784.) *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.