5 - 18 5 - 18
5 MELSEC FUNCTIONS
5.5.11 Multiplication of BCD 8-digit data DBMULTI_M
The specified two BCD 8-digit data are multiplied.
Function definition
BOOL DBMULTI_M (BOOL EN, ANY32 S1, ANY32 S2, ANY16(4) D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Multiplicand data (BCD 8-digit data)
S2
IN
Multiplier data (BCD 8-digit data)
D[0]
D[1]
D[2]
D OUT
Multiplication result
(ARRAY [0..3] OF ANY16)
D[3]
Lower 4 digits
Upper 4 digits
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BCD 8-digit data stored in
*)
(* dwData1 and dwData2 are multiplied, and the multiplication result is stored
*)
(* into array ArrayResult.
*)
DBMULTI_M (X0, dwData1, dwData2, ArrayResult);
Corresponding MELSEC command
DB* (BCD 8-digit data multiplication)
5.5.12 Division of BCD 8-digit data DBDIVID_M
Division is performed between the specified two BCD 8-digit data.
Function definition
BOOL DBDIVID_M (BOOL EN, ANY32 S1, ANY32 S2, ANY32(2) D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Dividend data (BCD 8-digit data)
S2 IN
Divisor data (BCD 8-digit data)
D[0] Quotient
D OUT
Division result
(ARRAY [0..1] OF ANY32)
D[1] Remainder
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, division is performed between the
*)
(* BCD 8-digit data stored in dwData1 and dwData2, and the division result is
*)
(* stored into array ArrayResult.
*)
DBDIVID_M (X0, dwData1, dwData2, ArrayResult);
Corresponding MELSEC command
DB/ (BCD 8-digit data division)
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: ......