28 BIT SHIFT FUNCTIONS
28.4 Rotating Data to the Right by n Bit(s)
1925
28
28.4 Rotating Data to the Right by n Bit(s)
ROR(_E)
These functions rotate the input value to the right by (n) bit(s), and output the operation result.
■Description, type, data type
■Operation processing
• These functions rotate the WORD or DWORD data type value input to (s) to the right by (n) bit(s), and output the operation
result, in the same data type as (s), from (d).
• Specify the number of bits to be rotated in (n).
Data type of (s): WORD, Value input to (n): 3 (The data rotates to the right by 3 bits.)
• Input a WORD or DWORD data type value to (s).
• Input an INT data type value to (n) (Number of bits to be shifted) within the following range.
Ladder, FBD/LD Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=ROR(s,n);
[With EN/ENO]
d:=ROR_E(EN,ENO,s,n);
Argument Description Type Data type
EN Execution condition (TRUE: Executed, FALSE: Not executed) Input variable BOOL
s (IN) Input Input variable ANY_BIT
n (N) Number of bits to be shifted Input variable ANY_BIT
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable ANY_BIT
Data type of (s): WORD Data type of (s): DWORD
Range: 0 to 15
The lower 4-bit data is used.
[Example]
If the input value is 6: 6
If the input value is 22: 6
Range: 0 to 31
The lower 5-bit data is used.
[Example]
If the input value is 6: 6
If the input value is 22: 22
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)
EN ENO
sd
n
WORD, DWORD
Right rotation by (n) bits
(s)
(d)
E4E1H
0010011100001111
270FH
E4E1H270FH
1110000111100100
WORDWORD