LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

formula node windows xp

Hello All

I use labview 5.0. 4 years ago, we develop a vi with a formula node inside. We never had problem using it with Windows NT, Windows 98. Now, I have a minor change to make in the formula inside. I made this modification and the only result i get is NaN (not a number). I put the formula as it was before and still have the same result : NaN.

I'll put here my formula (it ain't a big one) so someone can help me.

Tth = -R * C * (ln(1 - 0.8) - ln(1 - 0.4));
Tmax = Tth + (40/100 * Tth);
Tmin = Tth - (10/100 * Tth);

Thanks

Caroline
Caroline Paulin
R&D technician
Astroflex inc
Canada
0 Kudos
Message 1 of 11
(3,926 Views)
Is the first letter of the input parameter in the first line a lower case "l" (as in lima) or ann upper case "I" (as in India). If it's a lower case "ln", that can't be used as a parameter as it's reserved for the natural logarithm function. When I copy and paste the formula into a Formula Node, it shows as a lower case "ln".

What values are you passing in for the input parameters. I'm getting good results with the number combinations I'm trying, but they may not be close to you are using.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 11
(3,917 Views)
Hello Ed,

it's l as "lima" because I'm actually using natural logarithmic function to calculate the theorical charging time of a capacitor.

The values that I'm passing is C (capacitor) and R (resistance). The value of C is between 0,001 and 0,000000001 and the value of R is between 10 000 and 600 000.

The original formula node is exactly what I previously wrote and worked fine. But, when I change a parameter, like 50 rather then 40 in the second formula, the result I get is only NaN.


Caro
Caroline Paulin
R&D technician
Astroflex inc
Canada
0 Kudos
Message 3 of 11
(3,910 Views)


it's l as "lima" because I'm actually using natural logarithmic function to calculate the theorical charging time of a capacitor.





I should have guessed it was the natural logarithmic function instead of an input parameter. Sometimes I type faster than I think.

I've made a quick example VI with your formula that generates random numbers for "R" and "C" and I added a parameter for the '40' in the second line so it will divide every value from 1 to 100. I can't get it to come up with any NaN values. The example is attached. Try running it and see what happens. The Iteration count will stop on '100' if no NaNs are produced, and will stop at any value that does produce an NAN.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 11
(3,906 Views)
I can't open the file you have attached... Labview 5.0 tells me :

Ressource not found
An error occured loading VI....
Labview load error code 8: Could not load VI resource

Are you using a higher version that is not support by labview 5?

Caro
Caroline Paulin
R&D technician
Astroflex inc
Canada
0 Kudos
Message 5 of 11
(3,898 Views)
I didn't notice you said you were using LabVIEW 5.0, that VI is in 7.1.

I've saved it back to 5.0, though I only have back to 5.1, so I couldn't test it in 5.0. I did test it in every version in between and it worked fine.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 6 of 11
(3,888 Views)
It fails at iteration 1.....

could it be regional settings in my computer because it wouldn't be the first item wich didn't work well since we upgraded from windows 2000 to windows XP (the font size aint the same, much smaller, almost unreadable in every vi we have, but are still ok with NT4).....

I'll look what are the difference between My computer and the computer which run the application in the production department.

Or could it be that labview 5 isn't supported by Windows XP : maybe some dll are needed or something else is, in order to make it work properly.

Thank you for your time...
Caroline Paulin
R&D technician
Astroflex inc
Canada
0 Kudos
Message 7 of 11
(3,885 Views)
I wouldn't think regional settings would effect anything in the numeric data types. LabVIEW automatically compensates for those changes.

Are you getting NaN on all three outputs? Maybe you can break it down into smaller formulas to try and figure out where the problem is.

Try the attached version of my example. I've built your formula using functions along with the formula node. It has a big time delay in the loop so I could see that they were calculating the same values. Try deleting the formula node and see if it works with just the functions.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 8 of 11
(3,879 Views)
I have already downsized my formula to know what was the "source" of problem, like 5 min ago. The problem is 1-0.8 and 1-0.4..... if i put instead 1 - 8/10 and 1 - 4/10, it is fine, everything works... I've also tried to add 2 new inputs V1 and V2 to replace 0.8 and 0.4. And I'm passing 0,8 to V1 and 0,4 to V2 and the results is ok too. No more NaN.


As I use Windows XP in french, I tought the separator could have been a problem (in french we use "," for decimal number instead of "."

Since it's working this way, i'll go with that but it still bugs me as it was working fine without problem before XP.
Caroline Paulin
R&D technician
Astroflex inc
Canada
0 Kudos
Message 9 of 11
(3,874 Views)
Glad you figured it out.

It must have been using the "." for your decimal. I thought LabVIEW would compensate for that with different language settings, but maybe the formula node is a place where it can't. It seems to me you should have had a broken VI since it had illegal characters in the formula. If I try and use a “,” for a decimal, it breaks.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 10 of 11
(3,863 Views)