SHR
Function - Shift bits of a register to the right.
Inputs
Input |
Data type |
Description |
IN |
ANY |
Register. |
NBS |
ANY |
Number of shifts (each shift is 1 bit). |
Outputs
Output |
Data type |
Description |
Q |
ANY |
Shifted register. |
IMPORTANT!
If the option "SHR: do not duplicate the most significant bit" is checked in the "Project settings / Advanced" box, then the most significant bit is set to FALSE.
If the option is not checked, then the most significant bit is duplicated:
Remarks
Arguments can be signed or unsigned integers from 8 to 32 bits.
In LD language, the input rung (EN) enables the operation, and the output rung keeps the state of the input rung.
ST Language
Q := SHR (IN, NBS);
FBD Language
LD Language
The shift is executed only if EN is TRUE.
ENO has the same value as EN.
Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with HelpNDoc's Clean and Efficient User Interface