6.1.3.4.2 ADD
Function
Add ( + ), adds the value of input IN1 to the value of input IN2, and queries the sum at output OUT (OUT:=IN1+IN2)
LD Graphics
Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN1 | Var_Input | ANY_MAGNITUDE | Addend 1 |
| IN2 | Var_Input | ANY_MAGNITUDE | Addend 2 |
| out | Var_Output | ANY_MAGNITUDE | OUT:=IN1+IN2 |
Example
Add the value of variable a and variable b to variable c through the ADD instruction, as shown in the figure below: Three INT type variables are defined. This ADD instruction is executed by compiling and downloading to achieve the effect of c := a+b

warning
- In the initial state, it currently contains at least two input operands
- ADD is an extensible function, and input terminals can be added by clicking the "+" in the LD graph