03-27-2013 09:54 AM
I have a labview program with formulas in sub VI's. How do i go about changing those hard coded sub vi's formulas to putting them into a text file to make changes and updates easier to the formulas if needed with out stopping the program like you would do in text base coding like C++?
Thanks in advance!
03-27-2013 09:56 AM
Hi E,
to make ... updates easier to the formulas if needed with out stopping the program like you would do in text base coding like C++
I don't think you can change any formula in a compiled C(++) program without stopping that program and recompile it...
03-27-2013 10:25 AM
Your right. What i meant was how do you go about converting formulas from sub vis to text base formula that would make updates easier? Instead of rewiring the whole program for changes that needs to be made it is all read from a file that can be modified easier.
03-27-2013 10:43 AM
You can use a formula node. Sometimes big calculations get a little cumbersome in LabVIEW - that is when I use the formula node instead. Generally I prefer to use the LabVIEW primitives, though.
03-27-2013 10:44 AM
Bill Thanks for your reply. I will try to find some example to follow.
03-27-2013 10:48 AM
03-27-2013 10:55 AM
I don't think the formula node will accomplish what the OP wanted. In order to input equations/formulas from an external source at runtime you will need to implement a parser in your code that will evaluate the formula and execute it. Essentially you will be creating a calculator in your code. It is certianly doable but depending on how complex your formulas are it coude be a significant amount of work.
03-27-2013 10:58 AM
Another option, but not quite what you want, is to dynamically call your VIs that perform the forumulaic calculations. That way, if you want to change the formula used in the built executable, you only need to replace the dynamically called VI. This approach is a bit of work, but it makes no difference how easy or complex your formulas are to be.
03-27-2013 11:01 AM
aCe Thanks for the link!
03-27-2013 11:01 AM
Thanks Mark