LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a VI to run just by pressing the "Enter" Button?

I am developing a user app and dont want to have a menus, just a dialog box that runs when opened and then runs everytime the user presses "Enter". How do I do this?
0 Kudos
Message 1 of 9
(3,671 Views)
For example.
Put boolean button on the front panel and, right-clicking on it, search for Key Navigation dialog. Set as a navigation key along with another options. This boolean will always call your dialog sub-vi, placed in a case structure wired to your boolean button.
Sergey
0 Kudos
Message 2 of 9
(3,670 Views)
Sergey,
Thanx for your help, you got me going in the right direction. Now, here is the way I have it set up. I have a boolean going to my VI, with the vi itself in the true case and nothing in the false case. This is not working very well. What do I have to do to get it to stay there until the case is false?
Andy
PS thanx again for your help
0 Kudos
Message 3 of 9
(3,671 Views)
Should stay there till you change it. Pop the right mouse button up and go
to "mechanical action". It should be set to "switch when pressed". It it's
set to latch, then it is true when you press it and goes false again as soon
as it is read by the program. If you used one of the dialog buttons it may
be set to latch.

andyzoumas wrote in message
news:101-506500000005000000E2190000-982303670000@quiq.com...
> Sergey,
> Thanx for your help, you got me going in the right direction. Now,
> here is the way I have it set up. I have a boolean going to my VI,
> with the vi itself in the true case and nothing in the false case.
> This is not working very well. What do I have to do to get it to stay
> there until the case is false?
> Andy
> PS t
hanx again for your help
0 Kudos
Message 4 of 9
(3,670 Views)
Craig,
Thanx for your help. In the circumstances that we are talking, is it necessary for me to be "running countinously"? I was under the impression that this would work by me setting up my program to run on start. But it seems as though if I don't do run countinously the program will go through once, see that the button is false, and since me false case is empty, end the program. Am I doing something wrong? Please clarify. Thanx again for the help
Andy
0 Kudos
Message 5 of 9
(3,670 Views)
You should probably have your case structure and boolean control
within a while loop and wire a constant to the stop terminal.

Hope this helps,
Chris


On Mon, 26 Feb 2001 13:42:13 -0800 (PST), andyzoumas
wrote:

>Craig,
>Thanx for your help. In the circumstances that we are talking, is it
>necessary for me to be "running countinously"? I was under the
>impression that this would work by me setting up my program to run on
>start. But it seems as though if I don't do run countinously the
>program will go through once, see that the button is false, and since
>me false case is empty, end the program. Am I doing something wrong?
>Please clarify. Thanx again for the help
>Andy
0 Kudos
Message 6 of 9
(3,670 Views)
Andy,

My additional thought is that you really want to make menus of your own. Anyway for a requested behaviour you'll need a kind of menu polling.
To implement it you'll probably need vi server.
This can be implemented using while loop in a vi server. This server should poll boolean or enter key of the keyboard and then run menu-dialog vi. There are several ways of achieving this goal globally through the whole application.

One is to use boolean button in each vi(even not seen in a front panel bounds and not connected to any nodes). These booleans could be controlled using references, opened in vi server. This is needed if you want to get your menu dialog appearing independently of the current focus of the ap
plication (no matter which vi front panel is current).

Another way (more easy may be) is polling keyboard directly using system API. Take a look e.g. at: http://zone.ni.com/devzone/devzoneweb.nsf/opendoc?openagent&74DDE683A1AFF6988625683A000C0D73&cat=034E59A8530E09DF862568900018707A
But this has underground and your menu will make user angry: each time hi'll press enter, hi'll get your dialog.

Think twice before doing it these ways. Do you really don't want using regular menus? What is the main goal of the application: perfomance, data acquisition or GUI. This is a key.
Sergey
0 Kudos
Message 7 of 9
(3,671 Views)
In article <101-5065000000080000008B150000-982303670000@quiq.com>,
x@no.email (andyzoumas) wrote:

> I am developing a user app and dont want to have a menus, just a
> dialog box that runs when opened and then runs everytime the user
> presses "Enter". How do I do this?
>

Would you like me to mail you an example?

Regards

Bill

mailto:wsymonds@clara.co.uk
0 Kudos
Message 8 of 9
(3,670 Views)
Your dialog-box should be a sub-vi that runs at the beginning of your
main-vi an also from a case-structure, which is selected by a button,
which is activeted by .

andyzoumas schrieb:

> I am developing a user app and dont want to have a menus, just a
> dialog box that runs when opened and then runs everytime the user
> presses "Enter". How do I do this?
0 Kudos
Message 9 of 9
(3,670 Views)