LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
AdriaanEvert

speed up formula parsing by scripting/compiling the formula nodes to standard numeric functions

I very much like the formula parse and evaluate vi's. For me writing a formula is easier and I am making less mistakes writing formulas than wiring numeric nodes. Specially when the formula is taken from literature.
Unfortunately, the parsed formula is much slower than using standard numeric nodes. Browsing through the formula nodes, I notice that the formulas are parsed down to the same standard numeric nodes (add subtract etc.). Still the formula parsing method is much slower because of many case statements that have to be executed before arriving at the  level of the numeric building blocks.
I think from the status where the formula parsing blocks are now, it would be feasible to have the formula parsing blocks generate vi's using only numeric nodes so the formula parsing nodes will have the same performance as the standard labview mathematics. The best solution would be to include it in the building/compiling of the code.

 

Arjan

 

 

5 Comments
altenbach
Knight of NI

The formula parsing cannot be compiled because it is possible to modify the formulas at run time via a text control. It is an interperter!

 

If you like writing formulas, use the formula node. It is lightning fast (with the disadvantage that it cannot be changed at run time).

X.
Trusted Enthusiast
Trusted Enthusiast

What you are meaning to suggest is a tool that takes a FIXED formula and some of the parse and evaluate VIs and TRANSFORMS the whole thing into ANOTHER piece of code that only uses mathematic primitives.

Obviously, if you'd plan to pass a formula dynamically, this couldn't work, because the code cannot modify itself at run time.

Darin. K has developed something akin to what would address the first suggestion (not strictly speaking something that takes a piece of LabVIEW code and transforms it into another at edit time, but at least it takes a formula and transforms it into pure mathematic primitives).

AristosQueue (NI)
NI Employee (retired)

This idea is impossible because there is no compiler in the runtime engine. To have a runtime node that does compilation, obviously we would need to include that. Adding the compiler would be a substantial burden on the runtime engine. Adding that burden is an idea that R&D has rejected repeatedly over the years.

Darren
Proven Zealot
Status changed to: Declined
igagne
Member
Adriaan, Have you seen this node: http://zone.ni.com/reference/en-XX/help/371361L-01/glang/formula_node/ That might get you some of what you want.