ROL - Rotate left by n bits

Introduction

Returns an integer value rotated left by n bits.

Informal Syntax:

ROL( InValue, NValue )

Formal Syntax:

ROL( In:=InValue, N:=NValue )

Parameters

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

Return value

The function ROL returns In rotated left N places.

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

Examples

ExampleReturn Value
ROL( WORD#F0F0, 4 )WORD#F0F
ROL( 16, -1 )8

Standards Compliance

Table 25.4 - IEC 61131-3 2nd Edition.

Table 30.4 - IEC 61131-3 3rd Edition.

Further Information

Bit Shift Functions

For other bit shift functions.

Glossary

For definitions of the terms used in Fernhill SCADA.