Learn PLCs free
2 min read
Updated
Beginner

MUL

MUL

Quick answer

MUL is a PLC multiplication instruction: it multiplies numeric inputs and writes the product to a destination. It is commonly used for unit conversion, ratio calculations and analog scaling, but the chosen data types determine rounding, precision and overflow behavior.

Key Takeaways

  • MUL is a PLC multiplication instruction: it multiplies numeric inputs and writes the product to a destination. It is com...
  • Beginner-level topic in Functions & Function Blocks
  • Commonly used in: Analog-input and output scaling, Unit and engineering-value conversion
  • Related to: ADD, SUB, DIV

Detailed Definition

MUL performs numeric multiplication. In ladder or function block programming it is normally shown as an instruction with input operands and a destination; in Structured Text the equivalent operator is *. The exact operand count, enable behavior and supported data types depend on the controller family.

The important engineering decision is not the multiplication symbol itself, but the numeric path around it. Integer-only calculations can truncate fractions, while a product that is valid mathematically can overflow an INT or DINT destination. Convert to REAL or LREAL before the operation when a fractional result is required, and calculate the maximum possible product before choosing the destination type.

Evidence and review status

Instruction behavior was checked against current Rockwell Micro800 documentation. Syntax and supported types still need verification in the help for the controller and firmware used on the project.

Technical review date:

Critical behavior to understand

  • The destination type controls the representable result; storing 200 × 200 in a 16-bit signed INT exceeds its positive range.
  • Integer multiplication does not create fractional precision. Convert the operand before multiplying when the engineering result can contain a fraction.
  • Some platforms require all MUL operands to use the same type, while others apply implicit conversion rules.
  • A multiply instruction executes whenever its rung or enable condition is true; it is not inherently a one-shot operation.

Verification checklist

  1. 1Calculate the minimum and maximum possible product, including negative values.
  2. 2Confirm whether the platform reports, saturates or wraps on overflow.
  3. 3Test zero, full-scale, negative and just-over-range inputs.
  4. 4Check the order of operations and explicit casts in the actual IDE.

Worked example

Scale a 0–27,648 input to 0–100%

Use RawInput = 13,824 and calculate ScaledPercent := DINT_TO_REAL(RawInput) * 100.0 / 27648.0.

  1. 1Convert RawInput to REAL before multiplication.
  2. 2Multiply by the 100.0 engineering span.
  3. 3Divide by the 27,648 raw span.
  4. 4Repeat the test at raw values 0 and 27,648.

Expected result: The three test points produce approximately 0.0%, 50.0% and 100.0%. An integer-only version may lose the fractional portion.

Primary and technical sources

These links support the specific behavior or product identity described above. Project documentation and the target platform's help remain authoritative for implementation.

Common Questions

What is MUL?

MUL is a PLC multiplication instruction: it multiplies numeric inputs and writes the product to a destination. It is commonly used for unit conversion, ratio calculations and analog scaling, but the chosen data types determine rounding, precision and overflow behavior.

When should I use MUL?

MUL is particularly useful in scenarios such as Analog-input and output scaling and Unit and engineering-value conversion. Consider implementing it when you need reliable, efficient solutions for these types of applications.

What should I verify before using MUL?

Calculate the minimum and maximum possible product, including negative values. Confirm whether the platform reports, saturates or wraps on overflow. Test zero, full-scale, negative and just-over-range inputs. Check the order of operations and explicit casts in the actual IDE.

What are related concepts I should learn?

To fully understand MUL, you should also familiarize yourself with ADD, SUB, and DIV. These concepts work together in industrial automation systems.

Was this helpful?

Let us know if this glossary term helped you understand MUL better.

Your feedback helps us improve our glossary and create better content for the PLC programming community.

About Functions & Function Blocks

Reusable code blocks, standard functions, and custom libraries

Total Terms:20
Difficulty:Intermediate to Advanced

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch machine scenarios react. A 12-lesson curriculum across 8 PLC dialects — free account, no credit card.

Practice PLCs free →