LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do in-line conditional expressions work in Formula Node but not in 'Eval Formula Node.vi'?

'Eval Formula Node.vi' and a standard Formula node seem identical in most respects in terms of their functionality, however I'm stumped by the case of inline conditional expressions. 

 

I'd like to read in a string in the syntax "(expr)?(expr):(expr)" from a text file and recieve the output as a double.

The subVI seemed like the perfect tool since I was already using it to interpret a number of other calculations within the text file, however in this case the behavior is not as expected.

 

Has anyone else ever tried this? is there a different syntax needed between the two tools?

Are there other features of the Formula Note not replicated by this VI?  (so I can avoid them in future)?

 

For simplicity I've attached a little demo of the behavior.

 

I am currently working in 2010, which I know is getting on in years.

If the behavior is improved in later versions, that may be a good excuse to upgrade 🙂 

 

Thanks,

Elaine R.

0 Kudos
Message 1 of 4
(2,762 Views)

I've no idea what causes this behaviour, but can confirm that it's similar in LV2011 SP1. The formula node gives the expected answer, but the eval formula node function does not, instead returning error "-23083  Analysis: Bracket problem at the end"

 

MC

0 Kudos
Message 2 of 4
(2,735 Views)

Eval formula Node does not do any conditional expressions as far as I am aware.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 3 of 4
(2,722 Views)

@.aCe. wrote:

Eval formula Node does not do any conditional expressions as far as I am aware.


That is right. It's a rather dirty hacked VI library to do some formula evalution and has many limitations in comparison to the Formula Node including no support for conditional operator as well as some others. In addition it can also error on some more complex bracketed expressions.

 

It is an old example VI that was never revisited and probably never will be as writing a new one from scratch would be easier. But considering that the Formula Node and Mathscript and other possibilities exist, this is not likely going to happen soon.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 4
(2,714 Views)