ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

basic Labview question

Solved!
Go to solution

hi

I use labview 8.6.1

When I try to use the formula node, even with a very simple formula /:

x^3-x^2+5

when x equals 10 , it gives me the output of -6.1..

but it should be 905,

and some times it gives me an error of integer type required: e.g: y=x^3,when th input is 10.

0 Kudos
Message 1 of 8
(4,365 Views)
If you use the correct syntax for exponentiation, it works just fine. You must use '**'. This is documented in the help.
Message 2 of 8
(4,360 Views)

I ran into that exact same problem earlier.


Contrary to any intuition, the ^ operator does not mean exponent, it means bit XOR.

The operator you should use is **

 

Try this expression:

x**3 - x**2 + 5 

Cory K
Message 3 of 8
(4,358 Views)

In the formula node you need to use ** to indicate power. This is documented in the LabVIEW Help.

 

Any reason you're using the formula node as opposed to using straight G?

Message 4 of 8
(4,355 Views)
I see everybody is picking at the low-hanging fruit. Smiley Very Happy
0 Kudos
Message 5 of 8
(4,352 Views)
Instead of using the carat to raise a variable to a power, you will want to use the double asterisk that is documented in the LabVIEW help. Try using x**3-x**2+5 and you will get the answer you are looking for.
0 Kudos
Message 6 of 8
(4,336 Views)
Solution
Accepted by topic author sh3333

smercurio_fc wrote:
I see everybody is picking at the low-hanging fruit. Smiley Very Happy
Its a Monday Smiley Tongue 
Cory K
Message 7 of 8
(4,334 Views)
Maybe a monday but definetly not the solution...:smileyvery-happy:
0 Kudos
Message 8 of 8
(4,240 Views)