MULDIV_W: Multiplication/Division
Original instructions
Function description
The function MULDIV_W performs a weighted multiplication/division from 3 numerical input variables.
EN and ENO can be configured as additional parameters.
Formula
The equation says:
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD DigitalInput1
MULDIV_W DigitalInput2, DigitalInput3, Parameters
ST Result)
Representation in ST
Representation:
Result := MULDIV_W (DigitalInput1, DigitalInput2,
                     DigitalInput3, Parameters);
Parameter description MULDIV_W
Description of input parameters:
Parameter
Data type
Description
DigitalInput1 to DigitalInput3
Numerical variables to be processed
Parameters
Parameter
Description of output parameters:
Parameter
Data type
Description
Result
REAL
Result of the calculation
Parameter description PARA_MULDIV_W
Data structure description
Element
Data type
Description
k, c1 to c4
Calculation coefficients
Runtime error
This error will be signaled if a non floating point value is recorded or if there is a problem with a floating point calculation. In general, the output Result keeps its previous value, apart from with a division by 0, where the value corresponds to 1.#INF (infinite) depending on which sign the counter uses.
NOTE: For a list of all the block error messages and values, see Common Floating Point Errors.