5 - 17 5 - 17
5 MELSEC FUNCTIONS
5.5.9 Multiplication of BCD 4-digit data BMULTI_M
The specified two BCD 4-digit data are multiplied.
Function definition
BOOL BMULTI_M (BOOL EN, ANY16 S1, ANY16 S2, ANY32 D);
Argument Name
IN/OUT
Description
EN IN
Execution condition (Function is executed only when the
result is TRUE)
S1 IN
Multiplicand data (BCD 4-digit data)
S2
IN
Multiplier data (BCD 4-digit data)
D
OUT
Multiplication result (BCD 4-digit data)
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, the BCD 4-digit data stored in D1
*)
(* and D2 are multiplied, and the multiplication result is stored into Result.
*)
BMULTI_M (X0, D1, D2, Result);
Corresponding MELSEC command
B* (BCD 4-digit data multiplication)
5.5.10 Division of BCD 4-digit data BDIVID_M
Division is performed between the specified two BCD 4-digit data.
Function definition
BOOL BDIVID_M (BOOL EN, ANY16 S1, ANY16 S2, ANY16(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 4-digit data)
S2 IN
Divisor data (BCD 4-digit data)
D[0] Quotient
D OUT
Division result
(ARRAY [0..1] OF ANY16)
D[1] Remainder
Return Value
Description
BOOL Execution
condition
Example of use
(* When execution condition X0 turns ON, division is performed between the
*)
(* BCD 4-digit data stored in D1 and D2, and the division result is stored into
*)
(* array ArrayResult.
*)
BDIVID_M (X0, D1, D2, ArrayResult);
Corresponding MELSEC command
B/ (BCD 4-digit data division)
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: ......