LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

key down event to start something an stop arbirtrary

hallo,
 
what I'm trying to do is to start an event on key down an do a loop , something like move an axis for CNC , and this until i press an arbitrary key again.
i have already a while loop an an event structure so it would be good just to add something withtout large modifications.
have anyone an example code for me , please.
 
i've looked already in a lots of posts but i can't find anything usefull for me.
 
many thanks in advance
 
0 Kudos
Message 1 of 6
(2,886 Views)
Use the event for <vi> Key Down.  Check to see which key was pressed, then create a case to handle the appropiate keys.

LV7 example attached


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 2 of 6
(2,884 Views)

thank you but it just say a or not a ,what i want is a loop in this event which which will be executed till the next key is pressed so it ist unknown how many times this loop will be executet. i dont know how to handle this.

i can do what i want just 1 time and then i have to press again a key , but it should run until a key is pressed.

something linke in C:

while ( !kbhit() )

{

do something

}

0 Kudos
Message 3 of 6
(2,877 Views)
there's probably lots of way to do this - if you want to maintain the event/while loop structure, you could use a Master/Slave method.

LV7 examlple attached.


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 4 of 6
(2,873 Views)
this is exact what i wanted. thank you.
is there also a possiblity to start and stop with the same button  for ex. "a ".
 
regards,
Patrick
0 Kudos
Message 5 of 6
(2,862 Views)
again - lots of ways to do this.
The attached example is just the fastest I could modify the previous version Smiley Happy


2006 Ultimate LabVIEW G-eek.

0 Kudos
Message 6 of 6
(2,855 Views)