5 - 53 5 - 53
5 MELSEC FUNCTIONS
5.12 Shift
5.12.1 n-bit right shift SFR_M
The specified BIN 16-bit data are shifted n bits to the right.
Function definition
BOOL SFR_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 shifts (0 to 15) (BIN 16-bit data)
D
IN/OUT
Data to be shifted, shift result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data in D100 are shifted 4 bits *)
(* to the right.
*)
SFR_M (X0, K4, D100);
Corresponding MELSEC command
SFR (n-bit right shift of 16-bit data)
5.12.2 n-bit left shift SFL_M
The specified BIN 16-bit data are shifted n bits to the left.
Function definition
BOOL SFL_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 shifts (0 to 15) (BIN 16-bit data)
D
IN/OUT
Data to be shifted, shift result (BIN 16-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the data in D100 are shifted 4 bits *)
(* to the left.
*)
SFL_M (X0, K4, D100);
Corresponding MELSEC command
SFL (n-bit left shift 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: ......