LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog Box won't cooperate

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 4
(2,552 Views)
Solution
Accepted by topic author tidalwave62

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.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 4
(2,543 Views)

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

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 3 of 4
(2,536 Views)

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!

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