LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need one other function button

I am writing an application that navigates using an external stage. I want to use keyboard short cuts to mark and recal coordinates of my stage. I am using the event structrue for key down? I dont have a problem with this except ive only got access to the ctrl key, other keys wont work.  I have tried the discard value, but i think this isn't working because my event structure is only running with in a sequence structure within one of about 5 while loops. There is alot going on and i need to have the other things still running. I was finally going to resort to a ctrl-(whatever key) to save a point, and a ctrl-alt-(whatever key) to recall that point coordinate, but with both ctrl and alt held down, i get no value for "char' which im feeding to my case structure that accesses my array of coordinates. Additionally, i want to still be able to type in letters and numbers into controls, and this was disabled when i had the discard value working. Any Ideas? Ive messed with this all day, and read many related topics, but none seem work with the fact that ive got this event structure nested away in a few other structures. If i can get the discard to work at by a button on the front pannel, that would be ok (for example, the 'discard' button would switch when pressed, and allow me to use the alt key, but when switched the other way it will allow me to type in fields), ive already tryed a button outside of my structures wired to the event structure, but it still doesn't get it to discard.
0 Kudos
Message 1 of 5
(2,762 Views)

Well to simply answer your question you could hide two boolean butons and have them activated by hitting a button which in turn triggers the value changed event and from there you can initiate your code.


 


@Russell Pirlo wrote:
I am writing an application that navigates using an external stage. I want to use keyboard short cuts to mark and recal coordinates of my stage. I am using the event structrue for key down? I dont have a problem with this except ive only got access to the ctrl key, other keys wont work.  I have tried the discard value, but i think this isn't working because my event structure is only running with in a sequence structure within one of about 5 while loops. There is alot going on and i need to have the other things still running. I was finally going to resort to a ctrl-(whatever key) to save a point, and a ctrl-alt-(whatever key) to recall that point coordinate, but with both ctrl and alt held down, i get no value for "char' which im feeding to my case structure that accesses my array of coordinates. Additionally, i want to still be able to type in letters and numbers into controls, and this was disabled when i had the discard value working. Any Ideas? Ive messed with this all day, and read many related topics, but none seem work with the fact that ive got this event structure nested away in a few other structures. If i can get the discard to work at by a button on the front pannel, that would be ok (for example, the 'discard' button would switch when pressed, and allow me to use the alt key, but when switched the other way it will allow me to type in fields), ive already tryed a button outside of my structures wired to the event structure, but it still doesn't get it to discard.


Why are you putting your event structure into a sequence structure with multiple while loops. This seems like the long (wrong) way to do these things, try looking at the caveats for the event structure, and I would also suggest maybe a statemachine architecture or something similar.

Please post your code if you have any more trouble.

 

Here is an example that shows what I suggested




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 5
(2,741 Views)
thanks alot, thats all i needed, now im using page up and page down as my functional keys. 
one more not, i thought it read in the caveats that you should to put the event structure in a while loop...?
0 Kudos
Message 3 of 5
(2,717 Views)
....the other 4 while loops are other parts of my program running at the same time. ...
0 Kudos
Message 4 of 5
(2,717 Views)
Yes you should have your event structure in a while but not inside a sequence structure inside a while loop although if it works like you want it to then hey use it.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 5
(2,707 Views)