LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formula node calculation error

Hi all,
 
I am expecting the output of formula node as the value of "c" input variable. but it outputs NaN.  I am attaching jpeg file illustrating that.
 
Clarification would be appreciated.
 
 
Kousy
0 Kudos
Message 1 of 8
(4,812 Views)
Hi Kousy,
   first of all, I wouldn't rely so much on computations with "non-acutal-number" (I don't know how can I call -Inf, +Inf).

   Anyway, Inf/Inf = NaN, since you does not know which order is each Infinite, even if you have a zero multiplied at numerator.

   Of course, I refer to the "limit" algebra, because in math, it's nonsense to speak of (Inf/Inf) as division between numbers!

graziano
0 Kudos
Message 2 of 8
(4,809 Views)

Hi Kousy,

In your attached jpg, you set the input "a" as -Inf. And in your formula, you calculate (x-a)*(d-c)/(b-a). So you get the output as NaN.

You might need to check the value for parameter a.

mchen

0 Kudos
Message 3 of 8
(4,808 Views)

Hi,

 

My attached vi clarifies my problem.

Inf is creating a confusion i know, may be I need to do some work around.

 

Kousy

 

 

0 Kudos
Message 4 of 8
(4,782 Views)
On your front panel you say you're trying to interpolate values. Have you tried the built-in Threshold 1D Array and Interpolate 1D Array functions?
0 Kudos
Message 5 of 8
(4,762 Views)
I have not used these Threshold 1D Array and Interpolate 1D Array functions. Ill try and let you know whether this solves my problem.
0 Kudos
Message 6 of 8
(4,729 Views)
I can understand Threshold 1d array but not interpolate 1d array function.
still what iam trying to interpolate is..
attached vi explains..
 
Hope that helps.
 
can you attach an example for the above 2 functions?
 
 
0 Kudos
Message 7 of 8
(4,711 Views)
Hi Kousy,

look at attached example...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(4,708 Views)