LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Three Button Dialog keeps popping up

Solved!
Go to solution

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?

0 Kudos
Message 1 of 12
(2,256 Views)

grafik

 


@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager.


You probably press continues run, or call this VI in a loop.

 

If you want it to run once, you actually have to program this.

 

You can do all sorts of things to make it run once, but at some point, you should think long and hard about structuring your program (design, architecture) in stead of just making VIs.

 

The best way to call this only once is probably to put it in a sub VI and call this VI once, at the start of the program.

 

Don't use continuous run. In stead, put a loop around the code you want to continuously execute (not the popup).

 

Here's another way to avoid the dialog:

 

wiebeCARYA_0-1644485696855.png

It's a hack. You'll never get the dialog a 2nd time, until you change the code... You'll soon find you need a grand plan for your program.

 

 


@InfinityDE wrote:

so I have to shut down the whole program using the task-manager. 


Often you can stop your code by pressing "CTRL+." , even when dialogs pop up. Simply press CTRL+., and keep pressing it while using your mouse to press OK, NO or Cancel in the dialog.

0 Kudos
Message 2 of 12
(2,241 Views)
Solution
Accepted by topic author InfinityDE

@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?


One of the many, many reasons I hate the built in Three Button Dialog.vi and the absolutely hideous TBD Core.vi 

 

AQ even blushed when I mentioned it to him.  ( Hey, we've all written code that haunts us after we learn better.)

 

The trouble here is that you are using the Run Continuously button and TBD Core.vi uses polling in a greedy loop.  That leaves you a very poor User eXperience, UX, where you get upset and just mash the abort button.  That's like stopping your car buy running into a tree! (it's effective in stopping your car but, there may be undesired effects)

 

See here for a better TBD implementation and how to avoid the Three-Finger Salute.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 12
(2,206 Views)

@JÞB wrote:

@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?


One of the many, many reasons I hate the built in Three Button Dialog.vi and the absolutely hideous TBD Core.vi 

 

AQ even blushed when I mentioned it to him.  ( Hey, we've all written code that haunts us after we learn better.)


It's the same for One Button Dialog and Two Button Dialog.

 

CTRL+. works... Just keep pressing it.

 

This doesn't always work (e.g. when the dialog is in an infinite recursion or in cloned VIs).

 

Modal VIs are the real problem...

 

LabVIEW 4 on Win3.x was much worse. Forgetting a wait in a while loop would require a system reset, as there was only 1 thread, and it was entirely used by the loop.

0 Kudos
Message 4 of 12
(2,196 Views)

wiebe@CARYA wrote:

@JÞB wrote:

@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?


One of the many, many reasons I hate the built in Three Button Dialog.vi and the absolutely hideous TBD Core.vi 

 

AQ even blushed when I mentioned it to him.  ( Hey, we've all written code that haunts us after we learn better.)


It's the same for One Button Dialog and Two Button Dialog.


They call TBD Core.vi too.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 12
(2,192 Views)

Can you show us the full code of the caller? (Is there a toplevel while loop or are you using "continuous run"?)

0 Kudos
Message 6 of 12
(2,186 Views)

@JÞB wrote:


It's the same for One Button Dialog and Two Button Dialog.


They call TBD Core.vi too.


Nope, One Button Dialog and Two Button Dialog are core functions, they have nothing to do with the VIs that compose Three Button Dialog.vi.

0 Kudos
Message 7 of 12
(2,175 Views)

@Darren wrote:

@JÞB wrote:


It's the same for One Button Dialog and Two Button Dialog.


They call TBD Core.vi too.


Nope, One Button Dialog and Two Button Dialog are core functions, they have nothing to do with the VIs that compose Three Button Dialog.vi.


I must have misrememberd.  I keep all my dialogs on an Event driven template setting fp.behavior and fp.closable properties at runtime.  I should upgrade that vit to a vim


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 12
(2,168 Views)

@JÞB wrote:

wiebe@CARYA wrote:

@JÞB wrote:

@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?


One of the many, many reasons I hate the built in Three Button Dialog.vi and the absolutely hideous TBD Core.vi 

 

AQ even blushed when I mentioned it to him.  ( Hey, we've all written code that haunts us after we learn better.)


It's the same for One Button Dialog and Two Button Dialog.


They call TBD Core.vi too.


I mistook that for joke (I didn't get).

 

So there is actually a TBD Core.vi! I thought it was to be determined...

0 Kudos
Message 9 of 12
(2,118 Views)

wiebe@CARYA wrote:

@JÞB wrote:

wiebe@CARYA wrote:

@JÞB wrote:

@InfinityDE wrote:

Hey guys,

I want to implement a three button dialog for the user to choose between three options. Labeling and configuration of the three options works just fine. But when running my program, the dialog window opens but does not close after choosing one of the three options, so I have to shut down the whole program using the task-manager. How do I get this dialog to be called only once?


One of the many, many reasons I hate the built in Three Button Dialog.vi and the absolutely hideous TBD Core.vi 

 

AQ even blushed when I mentioned it to him.  ( Hey, we've all written code that haunts us after we learn better.)


It's the same for One Button Dialog and Two Button Dialog.


They call TBD Core.vi too.


I mistook that for joke (I didn't get).

 

So there is actually a TBD Core.vi! I thought it was to be determined...


The irony is that the TBD in TBD Core.vi is could also stand for Trashed Block Diagram.  Open it and see if it makes more sense.  <HINT: Do not even try Ctrl+U with default ini settings>

 

In AQ's defense.  He wrote it knowing that it might have to support multiple languages and y'all Deutschlanders seem to think words should be constructed with as many letters as possible. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 12
(2,109 Views)