LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dialog popup promting user to accept one of the options

I have a VI consisting of three sub VI's which perform the same application. I would like the program to pop up a dialog box asking the user which subvi he would like to proceed with. The program should lead to the appropriate sub vi and continue upon the user prompt. What can I do about this in LabVIEW 2012?

0 Kudos
Message 1 of 11
(3,751 Views)
0 Kudos
Message 2 of 11
(3,650 Views)

MAIN_BD.png

 

Save the above snippet (png file) to your PC, and drag&drop into your block diagram.

Message 3 of 11
(3,728 Views)

Blokk showed you how, if you had a Modal Dialog VI that would ask you "Which option do you want?" and would wait for you to answer the question, you could use to choose which option to do.  So now it boils down to writing the Modal Dialog VI.

 

Write an ordinary VI that lets you choose one of three options.  You can use a Radio Button box, or three booleans (with a Text label saying "Please choose one of the following".  You can decide "When I make a choice, then I'm done and can exit" (you can use an Event Structure to do this) or you can have a pair of buttons, called "Accept Choice" and "Cancel Choice", that the user is required to push.  You design how you want to handle this, and make it happen.

 

Now, before saving this sub-VI, right-click its icon and open its Properties.  Go to the Window Appearance, and choose Dialog.  Now push Customize, but only look, don't change anything.  Notice some interesting properties have been set -- the VI will "Show its Front Panel when called" (so you can see and interact with its controls) and will "Close afterwards if originally closed" (so it "goes away" when you are done).  Notice the Window Behavior is Modal, which means it "sits on top" of other windows and holds things up until it finishes.

 

If you want, you can go into the Window Run-Time Position and change the Position to Centered (so it pops up right in the middle of the screen, instead of "Where you last saved it".

 

You now have a Modal Dialog Box that will pop up, allow you to make a (very flexible, you-program-it, choice), and will disappear when you've made your choice.

 

Bob Schor

 

Message 4 of 11
(3,714 Views)

I dont seem to have the dialog using events vi, could you upload it?

0 Kudos
Message 5 of 11
(3,699 Views)

Did you read what I wrote at my post?

"Save the above snippet (png file) to your PC, and drag&drop into your block diagram."

 

The picture what you see is a png file which also includes the actual VIs, called snippet. Right click the picture, and choose "Save image as...". After you have saved this png file to your PC, you can drag and drop into an empty block diagram window for example...

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2PkCAI&l=en-US

0 Kudos
Message 6 of 11
(3,696 Views)

Blokk,

 

     This is from the note you referenced:

 

You can create VI Snippets that reference SubVIs but your end users need to have the SubVIs on their machines to be able to use the code.  VI Snippets only contain information from the block diagram you create them from.  If your code segment contains a SubVI, the SubVI is not embedded in the VI Snippet. 

 

The Original Poster's request is very reasonable, and why I provided the discussion of Modal Dialog Sub-VIs, as your sub-VI is not part of the Snippet you posted.

 

Bob Schor

Message 7 of 11
(3,680 Views)

Yes, you are right, sorry, my mistake.

SubVI attached.

Download All
Message 8 of 11
(3,670 Views)

also in LabVIEW version 2012...

Message 9 of 11
(3,659 Views)

Could you upload an example VI which works with the radio button box and the event structure?

0 Kudos
Message 10 of 11
(3,600 Views)