Yaskawa MotionWorks+ Windows Software User Manual
Page 70
Expression Builder
MotionWorks+™
64
Note: If a floating point result is expected, at least one of the terms in the calculation
must contain a floating point value. This is true even if the terms are all hard coded.
Example:
ACCEL = 1000 (integer)
VELOCITY = 180 (integer)
Calculation:
Answer = sqrt (ACCEL/VELOCITY)
The above calculation does not produce accurate results because none of the terms are
floating points. The answer should be 2.35702, but is reported as 406.
One solution is to multiply the expression by 1.0. Another solution appears on the
following page.
Example:
ACCEL = 100.0 (floating point)
VELOCITY = 180 (integer)
Calculations:
Answer = sqrt (ACCEL/VELOCITY) or
Answer = sqrt (ACCEL/180.0) will produce the correct answer: 2.35702.
[ ]
[
MyTable[Var2]
10000
sin
sin
sin(Var9*180)*4096.0
2048
cos
cos
cos(0)
1
tan
tan
tan(45)
1
arctan
acrtan
artan(1)
45
Square Root
sqrt
sqrt(9)
3
Absolute Value
abs
abs(mSpeed_Main)
36.274
True
true
Var5==true
1
False
false
Var5==false
0
Operator
Symbol
Example Expression
Result