Absolute value |x| of a number x is itself, if x is positive or zero, but if x is negative, then its absolute value |x| is its negation x, that is, the corresponding positive value. For example, |-1| = 1, but |2| = 2. The absolute value function strips a number of its sign.
Example
Equation: N7:120 = ABS (-10)
Ladder Logic Solution:
Example
Equation: N7:121 = ABS (-25)
Ladder Logic Solution
Note
- If the source is = 32768 (integer) this will generate a minor error fault. This error should be cleared to avoid a major error.
Example
Equation: F8:120 = ABS (-1.2345)
Ladder Logic Solution
Note
- If the source is a floating point then no overflow error will occur.