Multiply (MUL)

The MUL instruction multiplies Source A with Source B and places the result in the Destination.

Available Languages
-    Ladder Diagram
-    Function Block
-    Structured Text
This instruction is not available in structured text. *
* There is no equivalent structured text instruction. Use the operator in an expression.

Operands
-    Ladder Diagram
Operand
Type
Format
Description
Source A
SINT
INT
DINT
REAL
Immediate
tag
value of the multiplicand
Source B
SINT
INT
DINT
REAL
immediate
tag
value of the multiplier
Destination
SINT
INT
DINT
REAL
tag
tag to store the result

-    Function Block
Operand
Type
Format
Description
MUL tag
FBD_MATH
structure
MUL structure

-    Structured Text
Use the multiply sign "*" as an operator within an expression. This expression multiplies sourceA by sourceB and stores the result in dest.

dest := sourceA * sourceB;

FBD_MATH Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
SourceA
REAL
Value of the multiplicand.
Valid = any float
SourceB
REAL
Value of the multiplier.
Valid = any float

Output Parameter
Data Type
Description
EnableOut
BOOL
Enable output.
Dest
REAL
Result of the math instruction. Arithmetic status flags are set for this output.

Example
Multiply float_value_1 by float_value_2 and place the result in multiply_result.

-    Ladder Diagram
-    Function Block
-    Structured Text

multiply_result := float_value_1 * float_value_2;

File name: PLC-19_IS_CMI-MUL.pdf
File size: 419.36 KB

0 comments :