LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Eval Formula Node

All,

I'm trying to eval y=min(x,5) using the "eval formula node" with no luck (other functions works great). Ill appreciate any input.

thanks, Erez

 

0 Kudos
Message 1 of 13
(2,198 Views)

Hi Erez,

 

why do you need an "eval formula node"?

Best regards,
GerdW


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

@erezg wrote:

All,

I'm trying to eval y=min(x,5) using the "eval formula node" with no luck (other functions works great). Ill appreciate any input.

thanks, Erez


If you look in the sub VI "NI_Gmath.lvlib:Function Decomposition.VI", You'll notice min and max are not functions that are supported.

0 Kudos
Message 3 of 13
(2,151 Views)

@GerdW wrote:

Hi Erez,

 

why do you need an "eval formula node"?


One reason to use eval formula node (the VI, not the formula node), is to get a function as a string from a configuration file....

 

I guess most of us made replacements...

0 Kudos
Message 4 of 13
(2,146 Views)

thanks for the help 🙂

I guess Ill have to use a replacement as well.

 

0 Kudos
Message 5 of 13
(2,095 Views)

@erezg wrote:

thanks for the help 🙂

I guess Ill have to use a replacement as well.


I can highly recommend Dijkstra's Shunting-yard_algorithm as a starting point.

 

Not easy, but a lot easier that figuring it all out yourself. 

 

Of course, someone might share a solution... 

0 Kudos
Message 6 of 13
(2,088 Views)

BTW, is there a way to add the max/min to the function decomposition?

thanks

0 Kudos
Message 7 of 13
(2,008 Views)

I looked inside the eval function, and it looks like the final calculation is performed in 

"three register calculation.vi" (all the allowed function are there). I tried to relapse the "+" with "min", but with no luck.

Any idea?

 

0 Kudos
Message 8 of 13
(2,003 Views)

@erezg wrote:

Any idea?


Keep trying?

 

I won't start with replacing the + with min. + is an operator, not a function. I'd start with replacing a 2 parameter function, Or a 1 parameter function if there isn't one. This will be closer to what you want. Next step would be to add the function in stead of replacing it. This needs to be don in two places. The parsing, and the execution.

0 Kudos
Message 9 of 13
(1,991 Views)

Hi,

 


wiebe@CARYA wrote:

@erezg wrote:

Any idea?


I won't start with replacing the + with min. + is an operator, not a function. I'd start with replacing a 2 parameter function, …


I recommend to start with creating a copy of all those VIs from vi.lib before even thinking about editing them!

(Ofcourse only edit the copied VIs, not the ones from vi.lib!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 13
(1,986 Views)