LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

two buttons latch until released

Hello,

I am doing a project for my school and it's allmoust finished:) but i stucked on one problem. I need to have two buttons  "latch unlil released" first is activating by mouse button and for second one has to be turn on by shortcut on the keyboard. It should work like this - I press first one and hold, during this i press toggle on keyboard - it should make indicator flashing. I'v attached VI which should work for me - but it's NOT!! What is wrong??

 

shaker

0 Kudos
Message 1 of 5
(3,188 Views)
You have to use the key down feature. See the attached code.
Tim
GHSP
0 Kudos
Message 2 of 5
(3,160 Views)
I did notice with this that when you press f1 that it causes LabVIEW help to pop up. You may need to think about this.
Tim
GHSP
0 Kudos
Message 3 of 5
(3,158 Views)

Thanks for interesting, this VI helped a lot:) but it doesn't work good all the time...  i took your idea and changed it a bit. Is it posible to make two indepednend actions 1- one of the key on the keyboard is pressed then first indicaror is flashing and 2 - when mouse press button is pressed second indicator is flashing. it should be two independent things, moust of the time it will be pressed in the same time. Thanks again for Your help!

 

shaker

Message Edited by shaker on 05-06-2010 09:43 AM
0 Kudos
Message 4 of 5
(3,134 Views)

Hi Shaker!

 

Here are two solutions for the program you specified.

Serial: Though the events occur seemingly paralell, they are handlel after ech other. The difference is specified with the while loop timer (20 ms), at least you know the minimum difference

Paralell: Hopefully both events happen in same time (if you have at least two CPU cores, otherwise Windows will serialize it)

 

If you really want fully paralell events you need to design on Real-time operating system; unfortunately,Windows might overthink your ideas when it comes to event handling.

 

The VIs can be runned on between LV 8.0 - LV 2009.

 

Good luck experimenting it! 🙂

 

Best regards,

Matyas

Download All
Message 5 of 5
(3,067 Views)