5 - 68 5 - 68
5 MELSEC FUNCTIONS
5.14.19 32-bit data sort DSORT_M
n points of BIN 32-bit data, starting at the specified device, are sorted in ascending or descending order.
Function definition
BOOL DSORT_M (BOOL EN, ANY32 S1, ANY16 n, ANY16 S2, BOOL D1, ANY16 D2);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1
IN
Head of data to be sorted (BIN 32-bit data)
n
IN
Number of data to be sorted (BIN 16-bit data)
S2 IN
Number of data to be compared at one execution (BIN
16-bit data)
D1
OUT
Bit device to be turned ON at sort completion (bit data)
D2
OUT
System used device (BIN 16-bit data)
Remarks: Specify the sort order by turning ON/OFF SM703. When SM703 is OFF:
Ascending order, when SM703 is ON: Descending order
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, iData1 points of BIN 32-bit data,
*)
(* starting at dData, are sorted in ascending or descending order.
*)
DSORT_M (X0, dData, iData1, iData2, bData, iData3);
Corresponding MELSEC command
DSORT (32-bit data sort)
5.14.20 Total value calculation WSUM_M
n points of BIN 16-bit data, starting at the specified device, are all added.
Function definition
BOOL WSUM_M (BOOL EN, ANY16 S1, ANY16 n, ANY32 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Data from which total value will be calculated (BIN 16-bit
data)
n
IN
Number of data (BIN 16-bit data)
D
OUT
Total value storage destination (BIN 32-bit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, iData2 points of 16-bit BIN data,
*)
(* starting at iData1, are all added, and the result is stored into Result.
*)
WSUM_M (X0, iData1, iData2, Result);
Corresponding MELSEC command
WSUM (16-bit total value calculation)
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: ......