Name :Subtraction calculations

Symbol :SUB

Illustrate:

        Subtract the first input from the second input and assign the result to the output OUT.

Image:

Parameter:

Parameter | Statement | Type | Description
--- | --- | --- | ---
IN1 | Input | INT/SINT/DINT/UINT/USINT/UDINT/REAL/TIME |
    The first input value
IN2 | Input | INT/SINT/DINT/UINT/USINT/UDINT/REAL/TIME |
    The second input value
OUT | Output | INT/SINT/DINT/UINT/USINT/UDINT/REAL/TIME |
    Output value

Example:

LD:

ST:

TagOut := SUB(IN1 := TagIn1, IN2 := TagIn2);

Interpretation:

parameter | operand | value
--- | --- | ---
IN1 | TagIn1 | Enter a value：5
IN2 | TagIn2 | Enter a value：2
OUT | TagOut | Output value：3

        IN1 and IN2 input the corresponding type of data, and the subtraction calculation result is output by SUB.