LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Event Structure: How to use vkey with ENTER / RETURN keys

Hello NI users,
 
I'm using Labview 8.0
 
In order to  use keyboard ENTER key instead of clicking on the OK control button, I've been using the Key Navigation Toggle feature.  It works fine with a single Event structure, but for some reasons it doesn't work for multiple event structures laid out in a flat sequence (see attached example).
 
So I'm trying to display consecutive frames, one  at a time. User clicks on OK button to display the next frame.
Stop#1 displays Frame#2
Stop#2 displays Frame#3
and so on....
 
I tried using Vkey and link it to ENTER and RETURN key but wihout success.
 
Does anyone know the solution to ths problem?
 
I want the user to be able to:
Click on OK button
Use Enter key to control OK button
Use Return key to control OK button
 
Thanks,
 
Frank
0 Kudos
Message 1 of 5
(4,965 Views)
See if this works for you.  I'm using a property node to change the ToggleKeyBinding to the appropriate stop button before entering the loop that's waiting on a Value Change event for that stop button.
 
Additionally, I removed the Timeout event cases and the Wait functions from your code.  These are unnecessary when you use an event structure and all the actions happen as a response to some event you can configure.  This isn't always the case, but unless you're doing something like monitoring something external to your program, you probably don't have to have a timeout case.
 
Regards,
Robbie
Message 2 of 5
(4,947 Views)

That works perfectly!

Thanks Robbie,

Frank

0 Kudos
Message 3 of 5
(4,937 Views)

I noticed you “bind” all 3 Stop buttons toward Stop3 Button (See Key Navigation, Existing Binding, Control and Action: - Stop-_ Toggle, Key Assignment: Return.)

 

Questions:

 

1. I don’t understand how you bind a control to another control. It cannot be done from the Boolean Properties> Key Navigation screen at least

 

2. I do not understand the logic behind the above bindings (Stop1 bound to Stop3, Stop2 bound to Stop3,).  Could you elaborate or point toward a link / hints?

 

Thanks,

 

Frank

0 Kudos
Message 4 of 5
(4,930 Views)
Hi Frank,

He is not actually binding controls 1 and 2 to control 3.  That list just shows the existing bindings.  If you look at the properties for control 3, you will see that "Return" is selected for the Toggle property of the boolean.  You can add an event to one of the other controls and that will show up in the list of key bindings.  The reason that pressing Enter doesn't fire all 3 events is that only one of the event handlers is running at a given time.
0 Kudos
Message 5 of 5
(4,896 Views)