04-08-2020 02:15 PM
Hi all,
I would like to implement a feature that allows my user to perform text math on random channels from the Front Panel. I've checked out the math parser libraries, but they didn't feel too reliable with the tests I did. It didn't seem to support the pow() command even though documented nor longer variable names.
It just didn't feel like a well-rounded library, so I might end up rewriting parts of it to add the features I need.
Other possibilities would be to script a formula node in a new VI and call that dynamically or write a python file that performs the action and call that. Handling in- and outputs would be a bit of a pain for both these.
Does anyone have any ideas, how I could best implement this feature? Or maybe an insight as to why any of the above would be inadvisable?
Thanks in advance!
Solved! Go to Solution.
04-08-2020 02:21 PM - edited 04-08-2020 02:22 PM
Hi Peter,
@PeterFoerster wrote:
It didn't seem to support the pow() command even though documented
The help explicitely tells you "pow()" is not supported by the formula parser functions. Instead it tells you to use "**" instead…
04-08-2020 03:14 PM
Are you sure about this one?
You are, of course, completely correct. It says so right here: https://zone.ni.com/reference/en-XX/help/371361R-01/gmath/dif_pars_math_vis_formnode/
However, here: https://zone.ni.com/reference/en-XX/help/371361R-01/gmath/parser_vis_in_more_detail/
It links to the site, but it also tells you to:
Refer to Formula Node and Expression Node Functions for functions you can use with Formula Parsing VIs.
Which doesn't give you that information at all, which is where my confusion came from. (I'd also like to know why it isn't supported since it would have been easy enough to include)
Any thoughts on the text math?
04-08-2020 03:35 PM - edited 04-08-2020 03:40 PM
One alternative:
Expression Parser for LabVIEW by GPower
(Not quite the same, but still cool: Math Node - A new way to do math in LabVIEW )
04-08-2020 03:48 PM
04-15-2020 10:05 AM
Thanks for your input guys!
I really loved Darin's Latex solution. In terms of formula editing, this is very intuitive.