ROL - Rotate left by n bits

Introduction

Returns an integer value rotated left by n bits.

Informal Syntax:

ROL( In, N )

Formal Syntax:

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

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 Second Edition.

Table 30.4 - 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.