21 BIT SHIFT FUNCTIONS
21.4 n-bit Right Rotation
1007
21
21.4
n-bit Right Rotation
ROR(_E)
These functions rotate an input value rightward by (n) bits and output the result.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions rotate the 16-bit or 32-bit data (WORD or DWORD type) input to (s) right by (n) bits and output the result in
the same data type as (s) from (d).
• The number input in (n) is used as the number of right-rotation bits.
Ex.
When the data type of (s) is 16-bit data (WORD) and 3 is input in (n) (The bits are rotated right by 3 bits.)
• The input data to (s) is 16-bit data/32-bit data (WORD or DWORD type).
• A value input to (n) (Number of shift bits) is the INT type data value and within the following range.
Ladder diagram, 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: Execution, FALSE: Stop)
Input variable
BOOL
s(IN)
Input
Input variable
ANY_BIT
n(N)
Number of shift bits
Input variable
ANY_BIT
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d(ROR(_E))
Output
Output variable
ANY_BIT
When the data of (s) is 16-bit data (WORD)
When the data of (s) is 32-bit data (DWORD)
A value in (n) is within 0 to 15.
The lower 4-bit data of the value in (n) is used.
[Example]
When the input value is 6: 6
When the input value is 22: 6
A value in (n) is within 0 to 31.
The lower 5-bit data of the value in (n) is used.
[Example]
When the input value is 6: 6
When the input value is 22: 22
s
d
n
EN
ENO
s
d
n
n-bit rotation
WORD, DWORD
Data of 1)
IN (WORD)
270FH
E4E1H
WORD
0
1
0
0
1
0
0
0
1
1
1
0
0
1
1
1
270FH
0
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
E4E1H
Data of 2)
1)
2)
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......