6 - 41 6 - 41
6 IEC FUNCTIONS
6.6.3 Right rotation ROR
ROR_E
Data is rotated n bits to the right in a circle.
Function definition
ANY_BIT ROR ( 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 := ROR( D1,1 );
LD
SM400
MOV D1
D0
ROR D0
K1
LD,MOV,ROR
Function definition
BOOL ROR_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 right, and the result is stored into D100.
M0:=ROR_E( X0, D0, 1, D100 );
*)
*)
For the usable data type, refer to "3.2.2 About ANY type".
Summary of Contents for MELSEC L series
Page 1: ...Programming Manual Structured Text ...
Page 2: ......
Page 73: ...4 33 4 33 4 ST PROGRAM EXPRESSIONS MEMO ...
Page 297: ......