From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formula Node Calculation Issues

Solved!
Go to solution

I'm trying to make an array where the output is defined by the formula 25*(2^x) where x is the input variable, with integer iterations from 0 to 7.  To do this, I made an formula node and put it in a for loop.  Unfortunately the (^) symbol is not working right for the calculation.  I tested it simply with x^2 and this did not work, while having x*x returned the correct values.  Instead of outputting the correct values, it outputs seemingly random integers.  Anyone know why?  I am new to this software so I apologize if this this a common issue but I could not find help anywhere else.

0 Kudos
Message 1 of 4
(2,286 Views)
Solution
Accepted by DK08

The LabVIEW Help does explain the allowed operators (Help>Formula Nodes>Precedence of Operators). The '^' is a bit exclusive or. A '**' is exponentiation.

Message 2 of 4
(2,282 Views)

Thank you so much, I thought I was going crazy. 

0 Kudos
Message 3 of 4
(2,278 Views)

If you use the numeric primitives rather than a formula node, craziness can be avoided (well, sometimes).

 

Lynn

 

Not Formula Nodes.png

0 Kudos
Message 4 of 4
(2,269 Views)