5 - 49 5 - 49
5 MELSEC FUNCTIONS
5.11 Rotation
5.11.1 Right rotation (carry flag not included) ROR_M
The specified BIN 16-bit data are rotated n bits to the right, without the carry flag being included.
Function definition
BOOL ROR_M (BOOL EN, ANY16 n, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when
the result is TRUE)
n
IN
Number of rotations (0 to 15) (BIN 16-bit data)
D
IN/OUT
Data to be rotated, rotation result (BIN 16-bit data)
Remarks: When a bit device is specified in "D", the data in the specified number of
digits are rotated.
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data in D0 are rotated 3 bits to *)
(* the right, without the carry flag being included.
*)
ROR_M (X0, K3, D0);
Corresponding MELSEC command
ROR (Right rotation of 16-bit data)
5.11.2 Right rotation (carry flag included) RCR_M
The specified BIN 16-bit data are rotated n bits to the right, with the carry flag being included.
Function definition
BOOL RCR_M (BOOL EN, ANY16 n, ANY16 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when
the result is TRUE)
n
IN
Number of rotations (0 to 15) (BIN 16-bit data)
D
IN/OUT
Data to be rotated, rotation result (BIN 16-bit data)
Remarks: When a bit device is specified in "D", the data in the specified number of
digits are rotated.
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data in D0 are rotated 3 bits to *)
(* the right, with the carry flag being included.
*)
RCR_M (X0, K3, D0);
Corresponding MELSEC command
RCR (Right rotation of 16-bit data)
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: ......