LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert the following formula from C to LabView

I am new to Labview and am trying to convert a C program into Labview.
I converted a formula from C into Labview formula node as follows

if (db>273.15)
e=(exp(-5800.2206/db+1.3914993-.48640239*db+(.41764768*10^-4)*(db**2.0)-(.14452093*10^-7)*(db**3.0)+6.5459673*log(db))/1000.0)*rh;
else
e=(exp(-5674.5359/db+6.3925247-(.9677843*10^-2)*db+(.62215701*10^-6)*(db**2.0)+(.20747825*10^-8)*(db**3.0)-(.9484024*10^-12)*(db**4.0)+4.1635019*log(db))/1000.0*rh;

But this doesn't work. Could anyone show me where the syntax of the
formula went wrong?

Thanks in advance
-Naveen
0 Kudos
Message 1 of 2
(2,181 Views)
Hi Navaeen,

In your first case, there's a space in your ".4176 4768" and in the second case there's a space in "d b". That could've been caused by copy-and-paste from your labview code though.

The main problem should be the syntax of the "^" operator. Starting from LabVIEW 6.1, "^" represents the bitwise exclusive or (XOR). Use "**" for exponentiation.

And also you have a right parenthesis missing in your second case.

Dan
0 Kudos
Message 2 of 2
(2,181 Views)