Abs (absolute value), Function, N is a number – Yaskawa LEGEND-MC User Manual
Page 64

54
LEGEND-MC User’s Manual
@ABS (Absolute Value)
[Function]
DESCRIPTION:
@ABS returns the absolute value of a number or variable given in square brackets. Note that the @ABS
command is a function, which means that it does not follow the convention of the commands, and does not
require the underscore when used as an operand.
ARGUMENTS: @ABS [n]
where
n is a number
USAGE:
EXAMPLES:
While Moving
Yes
Minimum n value
-2147483647.9999
In a Program
Yes
Maximum n value
2147483647.9999
Not in a program
Yes
Default Value
---
Can be Interrogated
No
Default Format
---
Used as an Operand
Yes
Distributed Control
No, Local
OE 0,0,0,0
Program TEST
VAR1=-45.6
Set a variable equal to -45.6
MG @ABS[VAR1]
Display the absolute value of VAR1
VAR2=@ABS[VAR1]+100.404
Perform calculation
EN
End of program