Subtract
The content of the accumulator is subtracted from the result of the expression in the following brackets. The result is transferred to the accumulator.
Valid operands for this operator must be of one of the following data types: (INT, DINT, UINT, UDINT, REAL)
Operator only available in IL programming language.
LD | var_1 |
(* load var_1 in accu *) |
(* since bracket expression follows, save content of accu; process expression in brackets first *) |
||
SUB( | var_2 |
(* load var_2 in accu *) |
ADD | var_3 |
(* add var_3 to accu; store result in accu *) |
) | (* get saved accu content and subtract to actual content of accu; store result in accu *) |
|
ST | var_4 |
(* store accu in var_4 *) |