05-12-2012 09:27 PM
I want to use "fabs" in the formula node, but it appears the "undefined variable" information, showed in the following picture. Does anyone know how to solve it? Thanks a lot!
Solved! Go to Solution.
05-12-2012 10:10 PM
What is "fabs" supposed to mean?
It looks like you have it set up as a function. But that is not a valid function name. Search LabVIEW help for "formula node syntax". That help file will show you the functions that are valid in a formula node.
05-12-2012 10:15 PM
The fabs function doesn't work in the formula node, you only can use abs().
http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/formula_node_and_express/
Regards
05-13-2012 12:45 AM
But if I use "abs", it will lose accuracy for my data. And this manual says that labview support "fabs", check the attachment.
05-13-2012 02:58 AM
Which manual is this?
05-13-2012 03:07 AM
OK, found it. These are part of the manager functions. This has nothing to do with formula nodes.
(see also)
05-13-2012 03:18 AM
@xiaoquan wrote:
But if I use "abs", it will lose accuracy for my data.
Why? Have you actually tried?
According some casual testing, abs() works just fine on DBLs and returns the absolute value of the DBL as another DBL. (for example with an input of a= -5e99, abs(a)=5e99).
05-13-2012 04:27 AM - edited 05-13-2012 04:28 AM
Yes, I tried. It can be accurate to six decimal places. I tink maybe it is the limit of DBL. Do you know some other way to increase the accuracy? Thank you very much!
05-13-2012 11:01 AM
maybe with some code, "if else". Not elegant but functionally
05-13-2012 11:03 AM - edited 05-13-2012 11:04 AM
@xiaoquan wrote:
Yes, I tried. It can be accurate to six decimal places. I tink maybe it is the limit of DBL. Do you know some other way to increase the accuracy? Thank you very much!
That is simply not true! Make sure you change the display format of the indicator to show enough digits.
(right-click...display format...)
(If you still have problems, please attach your code with some typical data.)