SHR is an IEC bitwise shift operator that moves the bits of an operand to the right by a given number of places. It is written as erg := SHR (in, n), where in is the operand being shifted and n is the number of bit positions to shift. The result is assigned to the output variable erg, as shown in the structured text example where 16#45 shifted right by 2 gives 16#11.
| Language | structured text |
|---|---|
| Code | SHR |
| Group | bitwise shift |
| Syntax | erg := SHR (in, n) |
| Dialect | CODESYS |
| Name | Description |
|---|---|
| in | Operand which is shifted to the right |
| n | Number of bits to shift in to the right |