6 - 42 6 - 42
6 IEC FUNCTIONS
6.6.4 Left rotation ROL
ROL_E
Data is rotated n bits to the left in a circle.
Function definition
ANY_BIT ROL ( ANY_BIT S1, ANY_BIT n );
Argument
Argument Name
IN/OUT
Description
S1
IN
Data to be rotated
n
IN
Number of bits to be rotated
Remarks: Only a constant can be specified as the number of bits to be
rotated.
Return value
Return Value
Description
ANY_BIT
Rotation result data
Remarks:
Example of use
Argument Type
ST Program
Conversion Result
Used Instruction
INT
D0 := ROL( D1,1 );
LD
SM400
MOV D1
D0
ROL D0
K1
LD,MOV,ROL
Function definition
BOOL ROL_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 rotated
n
IN
Number of bits to be rotated
Remarks: Only a constant can be specified as the number of bits to be
rotated.
D1
OUT
Rotation result data
Return value
Return Value
Description
BOOL Execution
condition
Example of use
(*
(*
When execution condition X0 turns ON, the data stored in D0 is rotated 1 bit
to the left, and the result is stored into D100.
M0:=ROL_E( X0, D0, 1, 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: ......