21 BIT SHIFT FUNCTIONS
21.3 n-bit Left Rotation
1005
21
21.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 16-bit or 32-bit data (WORD or DWORD type) 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 16-bit data (WORD) and 3 is input in (n) (The bits are rotated left 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:=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(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(ROL(_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
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)
Содержание MELSEC iQ-F FX5
Страница 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Страница 2: ......
Страница 17: ...15 CONTENTS ...
Страница 24: ...22 MEMO ...
Страница 25: ...23 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW 2 PRECAUTIONS ON PROGRAMMING ...
Страница 126: ...124 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 132: ...130 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 140: ...138 6 SEQUENCE INSTRUCTIONS 6 3 Output Instructions Operation error There is no operation error ...
Страница 191: ...7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions 189 7 Operation error There is no operation error ...
Страница 202: ...200 7 BASIC INSTRUCTIONS 7 2 Arithmetic Operation Instructions Operation error There is no operation error ...
Страница 278: ...276 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 280: ...278 7 BASIC INSTRUCTIONS 7 4 Bit Processing Instructions Operation error There is no operation error ...
Страница 915: ...18 TYPE CONVERSION FUNCTIONS 18 13 Converting DWORD to WORD 913 18 Operation error There is no operation error ...
Страница 917: ...18 TYPE CONVERSION FUNCTIONS 18 14 Converting DWORD to INT 915 18 Operation error There is no operation error ...
Страница 932: ...930 18 TYPE CONVERSION FUNCTIONS 18 26 Converting DINT to WORD Operation error There is no operation error ...
Страница 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Страница 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Страница 1107: ...I 1105 MEMO ...
Страница 1111: ......