LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bad input to Eval formula can lead to an infinite loop

This is on LV 8.2, I haven't tried it in previous versions
If you enter
..
into Eval Formula String (or anything else that uses NI_Gmath.lvlib:Parse Formula String), it'll enter an infinite loop in the
NI_Gmath.lvlib:String to Tree.VI
This is due to NI_Gmath.lvlib:String to Tree Inner Part.vi never ending the analysis
Anything containing ".." where a number should be (or as part of the number like 1..5)  seems to cause it as well.

Currently I'm filtering out inputs containing ".." hopefully there aren't any other kinds inputs that can cause this (since when the infinite loop happens it locks up my program).

It would be helpful If someone has a fixed version of the parsing VI's or knows what kind of inputs (so I can filter all of them) can cause this infinite loop.



Message 1 of 3
(2,658 Views)
Matt:

As you mentionned, the infinite loop is caused because an incorrect syntax has been entered and the subVI does not really know how to handle it. If you drill down inside the VI, an error is actually generated, however, the VI does not break out of one of its while loops. As you said, it would be very nice if an error could be thrown when an invalid input is entered.

Regards,

Rudi N.
0 Kudos
Message 2 of 3
(2,632 Views)
"As you said, it would be very nice if an error could be thrown when an invalid input is entered."
 
It would be even better if the error that is thrown stops the while loop!Smiley Very Happy
0 Kudos
Message 3 of 3
(2,618 Views)