When compute is executed then copy, arithmetic, logical, or conversion operation residing in the expression field of this instruction is performed and the result is sent to the destination. The execution time of a Compute instruction is longer than that of a single arithmetic operation and uses more instruction words.
- Compute is used to convert from type of numbers to another.
- To manipulate numbers.
Example
Equation: F8:131 = N7:131 * (F8:130 ** 2) + N7:132 * F8:130 + N7:33
(AX² + BX + c), where A = 3, B =2, C = 1 and X = 2
Ladder Logic Solution
Note
- During the computation if any part results in an overflow value the minor error bit will be set. This error should be cleared to avoid a major error.
- Notice the use of ( ** ) which is equivalent to power.
Example
Equation: N7:130 = N7:134 * ABS(N7:135)
Note
- Compute takes more time than a simple math instruction.
- Expression can be up to 255 characters.
- All math instructions could be included in the Expression.