ROR - Rotate right by n bits

Help Contents

Introduction

Returns an integer value rotated right by n bits.

Informal Syntax:

ROR( In, N )

Formal Syntax:

ROR( In:=expression, N:=expression )

Parameters

ParameterTypeDescription
InANY_INTEGRALThe value to rotate.
NANY_NUMThe number of bits to rotate the value.

Return Value

The type of the return value is the same as the type of the In parameter.

The function ROR returns In rotated right N places.

If N is negative, the function rotates the value to the left.

Examples

ExampleReturn Value
ROR( WORD#F0F0, 4 )WORD#F0F
ROR( 16, -1 )32

Standards Compliance

Table 25.3 - IEC 61131-3 Second Edition.

Table 30.3 - IEC 61131-3 Third Edition.

Further Information

Bit Shift Functions

For other bit shift functions.

Glossary

For the meaning of terms used in Fernhill SCADA.