Shr_E - Mitsubishi Electric MELSEC FX Series Structured Programming Manual

Hide thumbs Also See for MELSEC FX Series:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
(Application Functions)
5.4.2
SHR(_E)
Outline
This function shifts data of specified bit length rightward by the specified number of bits.
1. Format
Function name
SHR

SHR_E

*1.
Output variable
2. Set data
Variable
EN
Input
_IN
variable
_K,_N (
ENO
Output
variable
*1
In explanation of functions, I/O variables inside ( ) are described.
Explanation of function and operation
1) This function shifts word [unsigned]/bit string [16-bit]/double word [unsigned]/bit string [32-bit] data stored
in a device specified in
using the data type of data stored in a device specified in
d
Data is shifted rightward by "n" bits specified in
Example: When word [unsigned]/bit string [16-bit] data is stored in a device specified in
s
bit string [16-bit] data)
270FH
0
0
27H
2) "n" bits from the most significant bit become "0".
152
FX
3U(C)
Structured ladder
D0
_IN
K1
_K
X000
SHR_E
EN
D0
_IN
K1
_N
Execution condition
Word device which stores data to be shifted rightward
(
)
s
Number of shifted bits
)
n
Execution status
Word device which will store data obtained by shift
(
)
d
rightward by "n" bits, and outputs the obtained data to a device specified in
s
specified in
n
270FH
(Word [unsigned]/
0
1
0
0
1
1
0
0
0
0
0
0
These bits become "0".
FX
3G
FX
2N(C)
Expression in each language
SHR(_IN,_K);
SHR
Example:
*1
D10
D10:=
SHR(D0,K1);
SHR_E(EN,_IN,_N,Output label);
Example:
ENO
SHR_E(X000,D0,K1,D10);
*1
D10
Description
.
n
27H
d
(Word [unsigned]/
bit string [16-bit] data)
1
0
0
0
0
1
0
0
0
1
0
0
5.4 Standard Bit Shift Functions
FX
1N(C)
FX
1S
FX
U
/FX
2C
ST
Bit
ANY_BIT
ANY_BIT
Bit
ANY_BIT
.
s
1
1
1
1
1
1
FX
0N
FX
0(S)
Data type
, and "8" is
s

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx-kp-ok-e09r927

Table of Contents