
18 BIT SHIFT FUNCTIONS
18.3 n-bit Left Rotation
795
18
18.3
n-bit Left Rotation
ROL(_E)
These functions rotate an input value leftward by (n) bits and output the result.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions rotate the WORD or DWORD type data input to (s) left 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 left-rotation bits.
Ex.
When the data type of (s) is WORD and 3 is input in (n) (The bits are rotated left by 3 bits.)
• A value input to (n) is the WORD or DWORD type data value.
• A value input to (n) (Number of shift bits) is the INT type data value and within the following range.
Ladder diagram
Structured text
[Without EN/ENO]
[With EN/ENO]
[Without EN/ENO]
d:=ROL(s,n);
[With EN/ENO]
d:=ROL_E(EN,ENO,s,n);
Argument
Description
Type
Data type
EN
Execution condition (TRUE: Execution, FALSE: Stop)
Input variable
BOOL
s
Input
Input variable
ANY_BIT
n
Number of shift bits
Input variable
ANY_BIT
ENO
Output status (TRUE: Normal, FALSE: Abnormal)
Output variable
BOOL
d
Output
Output variable
ANY_BIT
When the data type of (s) is WORD
When the data type of (s) is 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
3879H
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
3879H
Data of 2)
1)
2)
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......