SHL - Shift left by n bits

Help Contents

Introduction

Returns an integer value shifted left by n bits.

Informal Syntax:

SHL( In, N )

Formal Syntax:

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

Parameters

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

Return Value

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

The function SHL returns In shifted left N places.

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

Examples

ExampleReturn Value
SHL( 1, 4 )16
SHL( 16, -1 )8

Standards Compliance

Table 25.1 - IEC 61131-3 Second Edition.

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