Skip to main content

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

alt text

Parameter description

Interface variableDeclarationData typeDescription
IN1Var_InputANY_MAGNITUDEAddend 1
IN2Var_InputANY_MAGNITUDEAddend 2
outVar_OutputANY_MAGNITUDEOUT:=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

alt text

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