Table of Contents

SHR

Function name

SHR

ST call

PROGRAM SHR_DEMO
    VAR
      WORD1,WORD2: WORD;
    INT1: INT;
   END_VAR
    WORD2:= SHR(IN:=WORD1,N:=INT1);
END_PROGRAM

Description

The function moves the bit pattern from left to right. The moved bits are set to zero.

Inputs

InputType Description
IN ANY_BITInput value
N ANY_INTNumber of bits to move the value to right

Outputs

OutputType Description
ANY_BITOutput value

Application example