Add ADD
Dest = A + B.
ADD
AGlobal.PartsA2BGlobal.PartsB3DestGlobal.Total5
| Tag | After two scans |
|---|---|
| PartsA | 2 |
| PartsB | 3 |
| Total | 5 |
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 ADD to total values or to count up by any step.
ADD
AGlobal.GoodParts40BGlobal.BadParts2DestGlobal.Total42
GEQ
AGlobal.Total42BGlobal.BatchSize42
Global.BatchDoneOTE
| Tag | Value |
|---|---|
| GoodParts | 40 |
| BadParts | 2 |
| Total | 42 |
| BatchSize | 42 |
| BatchDone | 1 |
Total is 42, which reaches the batch size.
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
- Adding past the largest DINTA result too big for Dest is a fault and Dest is not changed.
Learn it in a lesson
- Moving and calculating dataIntermediate · 25 min