Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 248 of 909
ABS(value)
Absolute Value of ()
APPLICATION: Math function
DESCRIPTION: Gets the absolute integer value of the specified variable or num-
ber
EXECUTION:
Immediate
CONDITIONAL TO: N/A
LIMITATIONS: N/A
READ/REPORT: RABS(value)
WRITE: N/A
LANGUAGE ACCESS: Assignment, formulas and conditional testing
UNITS: N/A
RANGE OF VALUES: Input: -2147483648 to 2147483647
Output: 0 to 2147483647
TYPICAL VALUES: N/A
DEFAULT VALUE: N/A
FIRMWARE VERSION: 5.x and later
COMBITRONIC: N/A
DETAILED DESCRIPTION:
The ABScommand gets (reads) the absolute integer value of the specified variable or
number. For example:
x=ABS(value)
sets the variable x to the absolute integer value of the variable or number specified in (value).
The ABS command cannot have math arguments and cannot be a variable or value from
another motor. For example, x=ABS(PA) is allowed, but x=ABS(PA:3) is not allowed.
There is a special case when using this function—the input value of -2147483648 will output
2147483647. The positive value2147483648 cannot be represented in a 32-bit value. If the
user finds this special case unacceptable, then the user must first test the input value for this
special case and provide an alternative action.
EXAMPLE:
a=ABS(-5) 'Set variable = ABS(-5)
PRINT(a,#13) 'Print value of variable a
RABS(-5) 'Report ABS(-5)
END
Program output is:
5
5
Part 2: Commands: ABS(value)