Right Rotation - Mitsubishi Electric MELSEC Q Series Programming Manual

Structured text
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

6 IEC FUNCTIONS

6.6.3 Right rotation

Data is rotated n bits to the right in a circle.
Function definition
Function definition
6 - 41
ROR
ROR_E
ANY_BIT ROR ( ANY_BIT S1, ANY_BIT n );
Argument
Argument Name
IN/OUT
S1
IN
n
IN
Return value
Return Value
ANY_BIT
Rotation result data
Remarks:
Example of use
Argument Type
INT
D0 := ROR( D1,1 );
BOOL ROR_E( BOOL EN, ANY_BIT S1, ANY_BIT n, ANY_BIT D1 );
Argument
Argument Name
IN/OUT
EN
IN
S1
IN
n
IN
D1
OUT
Return value
Return Value
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 );
Data to be rotated
Number of bits to be rotated
Remarks: Only a constant can be specified as the number of bits to be
rotated.
ST Program
Conversion Result
LD
MOV
ROR
Execution condition (Function is executed only when the result is TRUE)
Data to be rotated
Number of bits to be rotated
Remarks: Only a constant can be specified as the number of bits to be
rotated.
Rotation result data
For the usable data type, refer to "3.2.2 About ANY type".
Description
Description
Used Instruction
SM400
LD,MOV,ROR
D1 D0
D0 K1
Description
Description
*)
*)
6 - 41

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents