Multiply MUL
Dest = A × B.
MUL
AGlobal.Boxes26BGlobal.PerBox4DestGlobal.Items24
| Tag | After two scans |
|---|---|
| Boxes2 | 6 |
| Items | 24 |
| PerBox | 4 |
How it works
While the rung is true, writes Source A × Source B to the destination each scan. A fault, such as a divide by zero, leaves the destination unchanged.
How it's used
Use MUL to scale a count, such as boxes into items.
MUL
AGlobal.Boxes6BGlobal.PerBox4DestGlobal.Items24
| Tag | Value |
|---|---|
| Boxes | 6 |
| PerBox | 4 |
| Items | 24 |
6 boxes of 4 make 24 items.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| A | DINT, REAL or a number | Reads |
| B | DINT, REAL or a number | Reads |
| Dest | DINT, REAL | Writes |
Common mistakes
- Expecting a huge result to wrap roundA result too big for Dest is a fault and Dest is not changed.
Learn it in a lesson
- Moving and calculating dataIntermediate · 25 min