6 - 39 6 - 39
6 IEC FUNCTIONS
6.6 Bit Shift Functions
6.6.1 Bit left shift SHL
SHL_E
The specified data is shifted n bits to the left.
Function definition
ANY_BIT SHL ( ANY_BIT S1, ANY_BIT n );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be shifted
n
IN
Number of bits to be shifted
Remarks: Only a constant can be specified as the number of bits to be
shifted.
Return value
Return Value
Description
ANY_BIT Shifted
data
Remarks: n bits of data from the least significant bit are 0.
Remarks:
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
INT
D0 := SHL( D1,1 );
LD
SM400
MOV D1
D0
SFL D0
K1
LD,MOV,SFL
Function definition
BOOL SHL_E( BOOL EN, ANY_BIT S1, ANY_BIT n, ANY_BIT D1 );
Argument
Argument Name
IN/OUT
Description
EN
IN
Execution condition (Function is executed only when the result is TRUE)
S1
IN
Data to be shifted
n
IN
Number of bits to be shifted
Remarks: Only a constant can be specified as the number of bits to be
shifted.
D1 OUT
Shifted
data
Remarks: n bits of data from the least significant bit are 0.
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
When execution condition X0 turns ON, the data stored in D0 is shifted 2 bits
to the left, and the result is stored into Result.
M0:=SHL_E( X0, D0, 2, D100 );
*)
*)
For the usable data type, refer to "3.2.2 About ANY type".
Содержание MELSEC L series
Страница 1: ...Programming Manual Structured Text ...
Страница 2: ......
Страница 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Страница 297: ......