LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text Math on UI

Solved!
Go to solution

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!



Remember Cunningham's Law
0 Kudos
Message 1 of 6
(2,055 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,048 Views)

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?



Remember Cunningham's Law
0 Kudos
Message 3 of 6
(2,025 Views)
Solution
Accepted by topic author PeterFoerster

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 )

Message 4 of 6
(2,018 Views)
Solution
Accepted by topic author PeterFoerster

Check out this link 

 

mcuff

Message 5 of 6
(2,008 Views)

Thanks for your input guys!

I really loved Darin's Latex solution. In terms of formula editing, this is very intuitive.



Remember Cunningham's Law
0 Kudos
Message 6 of 6
(1,907 Views)