Returns an integer value shifted right by n bits.
Informal Syntax:
Formal Syntax:
SHR( In:=expression, N:=expression )
| Parameter | Type | Description |
|---|---|---|
| In | ANY_INTEGRAL | The value to shift. |
| N | ANY_NUM | The number of bits to shift the value. |
The type of the return value is the same as the type of the In parameter.
The function SHR returns In shifted right N places.
If N is negative, the function shifts the value to the left.
| Example | Return Value |
|---|---|
| SHR( 16, 4 ) | 1 |
| SHR( 16, -1 ) | 32 |
IEC 61131-3 Second Edition: Table 25.2.
IEC 61131-3 Third Edition: Table 30.2.
For other bit shift functions.
For the meaning of terms used in Fernhill SCADA.