SHR_RBIT_***: Right shift on an integer or double integer
Original instructions
Function description
The SHR_RBIT_*** function performs a shift to the right on an integer or a double integer with sign extension and recovery of the shifted bits.
The additional parameters EN and ENO can be configured.
Available functions
List of available functions:
Representation in FBD
Representation applied to a double integer:
Representation in LD
Representation applied to a double integer:
Representation in IL
Representation applied to a double integer:
LD Input_Var
SHR_RBIT_DINT Shift_Num, Shifted_Var, Shifted_Bits
Representation in ST
Representation applied to a double integer:
SHR_RBIT_DINT(Input_Var, Shift_Num, Shifted_Var, Shifted_Bits);
Description of the parameters
The following table describes the input parameters:
Parameter
Type
Comment
Input_Var
Variable on which the shift is to be performed.
Example: Input_Var = 2#10000000111100010000000011001111.
Shift_Num
Value of the shift to be performed.
Example: Shift_Num = 6.
The following table describes the output parameters:
Parameter
Type
Comment
Shifted_Var
Shifted_Var contains the value of Input_Var shifted by the number of bits given by Shift_Num. With conservation of the sign and propagation of the sign bit in the bits liberated by the shift.
Example: with the data examples of the previous table, the result is the following Shifted_Var = 2#1 1111110000000111100010000000011
Shifted_Bits
Shifted_Bits contains the shifted bits.
Example: with the data examples of the previous table, the result is the following Shifted_Bits = 2#00000000000000000000000000001111