08-22-2013 03:24 PM
Hello,
I have been grappling with this issue for quite some time, and I beleive it has something to do with the way I have it set up.
In my program, the user clicks a button to make a case structure TRUE, which turns on a subvi in the structure. (See attached "MainVI")
I have a couple quirks I would like to work out...
Immediately after clicking "run" for the first time, all seven of my dialog boxes appear one on top of another, obviously without the buttons being pressed. The strange thing it is that it only happens on the first run. So, if I click "stop" and then "run" again, the program behaves normally, with no popup boxes immediately appearing. Attached is an example program with the issue.
I've attempted to play with latching buttons, and playing with the SubVI properties as well.
I apologize if this is something stupidly simple, I'm at my wits end at this point! I know it has to be something I'm doing wrong, either with the button or how im executing the subVI or the VI itself.
Thanks,
Joe
Solved! Go to Solution.
08-22-2013 03:44 PM
You have a race condition, the initializing of the control to false is happening at the same time that the while loop is checking the value. The while loop happens to be winning the race and reads true before the value is initialized to false. Wire the error out of the property node "value" to the while loop and all will be well. That said that code architecture is pretty weak. Do yourself a favor and check out the Queued Message Handler template project that ships with LabVIEW.
08-22-2013 03:56 PM
And put some timing in there! You've got it running at the speed of the computer's clock, which gums up the works and makes the operator have to shut down LabVIEW (or even the PC) in order to stop the VI.
Cameron
08-22-2013 04:03 PM
Thank you both for your input, It worked! I'm still pretty inexperienced in labview so I will defintiely read up on the message handler topic.
Thanks Again!