Standard function blocks
294
Outputs Output (O): INT, DINT
ROR
(10014)
Illustration
Execution time 1.28 µs
Operation Input bits (I) are rotated to the right by the number (N) of bits defined by BITCNT. The N
least significant bits (LSB) of the input are stored as the N most significant bits (MSB) of
the output.
Example: If BITCNT = 3
Inputs The input data type is selected by the user.
Input (I): INT, DINT
Number of bits input (BITCNT): INT, DINT
Outputs Output (O): INT, DINT
SHL
(10015)
Illustration
Execution time 0.80 µs
Operation Input bits (I) are rotated to the left by the number (N) of bits defined by BITCNT. The N
most significant bits (MSB) of the input are lost and the N least significant bits (LSB) of
the output are set to 0.
Example: If BITCNT = 3
ROR
(DINT) 60
TLA1 1 msec (1)
BITCNT
I
O
O(60)
I 11100000111001011101001100110101
O 10111100000111001011101001100110
3 MSB
3 LSB
SHL
(DINT) 61
TLA1 1 msec (1)
BITCNT
I
O
O(61)
I 11100000111001011101001100110101
O 00000111001011101001100110101000
3 MSB
3 LSB