LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a simple dialog pop up that inputs a Word (number) from the user?

When my program starts, it looks in a file and tries to read a config file. Using what it finds, it tries to communicate with a pair of instruments. If this fails, it tries some default values, and failing this, it is to ask the user.

The thing is, I want it to pop up with a thing with a simple message that explains what you're to input, and then has two areas where you input numbers, and closes when you hit OK. However, I have no idea how to even make a pop up other than the one or two button dialog options. Where should I start? Is this ActiveX stuff? Or is there a built in method of doing this? (I'm using Labview 5.0.1)

Thanks,
-Dobbs
0 Kudos
Message 1 of 4
(2,798 Views)
You can create a new vi, place it as a subVI and in VI setup, check open when called and close afterwards if originally closed. When you want (maibe using a case) you make this sub VI execute and so, you only need it to be a while loop controlled by the OK button and two controls for your data wired outside the loop to indicators, so that you can set them as outputs and pass data.
Hope this helps
Message 2 of 4
(2,798 Views)
You need to make a sub-vi that contains the message and inputs you need on the front panel. Put the controls in a while loop inside the sub-vi that stops when you press the ok button. Wire the controls to indicators that are attached to the connector pane. To do this right-click on the vi icon in the upper right corner of the front panel window and select "Show Connector", then wire the indicators to the terminals on the connector pane using the wiring tool. Next change the display settings, right click on icon again and select "VI Properties". You need to change it to display front panel when loaded and close when done.

Now put this sub-vi in the diagram for your main vi where you want the user input. When you run your main vi it should display your sub-vi
when it gets to that point.

Hope this helps
Brian
Message 3 of 4
(2,798 Views)
In addition to the previous instructive answers to your question, I can provide you with an example.

Attached is a subVI, TwoNumbers.vi, that you can call when you want this dialog to pop up. It will ask the user for two numbers and then output the numbers for you to use in your main program. You can edit the text and re-name the controls to fit your needs. I hope this helps.

/Mikael Garcia
Message 4 of 4
(2,798 Views)