LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

numerical evaluation of a string

does anyone know how to do this?

for example, i have this string:

3*A+5-6*B

i want to plug in values for A and B (which i know how to do). then have the expression evaluated and give me a result. the operation is much more complex than this, and has to iterated about 600 times, so it becomes very complicated to do this with simple math.

Harley
0 Kudos
Message 1 of 3
(2,671 Views)
Harley,

It's hard to tell which LabVIEW functions you're familiar with and which you aren't, so apologies if I suggest something you're already aware of. I think more detail on exactly what you're trying to do might help.

One thought is to check out the Analyze >> Mathematics >> Formula palette and make sure you are aware of all the options there. If your main problem is the evaluation of a complicated multi-variable expression, then a good solution is Eval Multi-Variable Scalar.vi (on the Advanced subpalette of the Formula palette).

One thing that's not clear is why a more complicated mathematical expression, or the need to iterate many times, is a problem. Neither aspect really should make your effort much more difficult, assuming you've found the LabVIEW tools to accomplish the core task.

Hope that helps,
John
0 Kudos
Message 2 of 3
(2,667 Views)
HDS,

The formula node found on the structures palette allows you to do just as you are describing. Right-click on the border to add inputs or outputs. You can program using pseudo-C type functions. (see context help for more information on syntax) For iterations you have two choices: perform the iterations in the formula node using a loop...like in C....or place a loop around the formula node and use shift registers.

-cheers,
Brett
0 Kudos
Message 3 of 3
(2,644 Views)