Operator - Performs an addition of all inputs.
IN1 : ANY
First input
IN2 : ANY
Second input
Q : ANY Result: IN1 + IN2
All inputs and the output must have the same type. In FBD language, the block may have up to 16 inputs. In LD language, the input rung (EN) enables the operation, and the output rung keeps the same value as the input rung. In IL language, the ADD instruction performs an addition between the current result and the operand. The current result and the operand must have the same type.
The addition can be used with strings. The result is the concatenation of the input strings.
Q := IN1 + IN2;
MyString := 'He' + 'll ' + 'o'; (* MyString is equal to
'Hello' *)
(* the block may have up to 16 inputs *)
(* The addition is executed only if EN is
TRUE *)
(* ENO is equal to EN *)
Op1: LD IN1
ADD IN2
ST Q (* Q is equal
to: IN1 + IN2 *)
Op2: LD IN1
ADD IN2
ADD IN3
ST Q (* Q is equal
to: IN1 + IN2 + IN3 *)