Download Modicon 984 Programmable Controller Systems Manual

Transcript
10.2 SUB
The SUB instruction performs an absolute subtraction (without signs) of
value 1 - value 2 and stores the result in a holding register. It can be used as a
comparator, identifying whether value 1 is greater than, equal to, or less than value 2. SUB is a three-node function block:
ON = value 2
subtracted from
value 1
value 1
value 1 > value 2
value 2
value 1 = value 2
SUB
result
value 1 < value 2
The top node and middle node are value 1 and value 2, respectively—they can
be:
Decimals ranging from 1 ... 999 in a 16 bit CPU and from 1 ... 9999 in a 24 bit
CPU
Input registers (3x)
Holding registers (4x)
The bottom node indicates that this is a SUB function and contains a holding register (4x) where the result of the subtraction is stored.
GM--0984--SYS
Standard Calculate Functions
135