LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

formula at run time

Hi everyone



I need to create a piece of code that takes a number of channels and creates
a new channel making use of a formula, this is no problem if you want to
hard code the formula, but it seems almost impossible if you want to change
the formula at run time.

Any suggestions?



Thanks



Jannie


0 Kudos
Message 1 of 2
(2,625 Views)

There are VIs that come with LabVIEW (probably full / pro only) that let you do this, provided I understand what you're asking.

I suggest searching the palettes for "Eval Formula String.vi".  This is the "easy" way to do it, but it will parse your formula string every time it is called.  This parsing can be rather time consuming.  If you want to do the parsing first, and then run the calculation multiple times, you can split up the parsing and evaluation by using "Parse Formula String.vi" first, then use the outputs from it to a call to "Eval Parsed Formula String.vi" inside a loop.

Message 2 of 2
(2,619 Views)