21 BIT SHIFT FUNCTIONS
21.2 n-bit Right Shift
1003
21
21.2
n-bit Right Shift
SHR(_E)
These functions shift an input value rightward by (n) bits and output the result.
Setting data
■
Descriptions, types, and data types
Processing details
■
Operation processing
• These functions shift 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-shift bits.
Ex.
When the data type of (s) is 16-bit data (WORD) and 8 is input in (n)
• "0" is set to "n" bits from the most significant bit.
• 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:=SHR(s,n);
[With EN/ENO]
d:=SHR_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(SHR(_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
IN (WORD)
270FH
27H
WORD
0
1
0
0
1
0
0
0
1
1
1
0
0
1
1
1
270FH
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
27H
0
Содержание 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: ......