05-06-2010 07:50 AM
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
05-06-2010 08:20 AM
05-06-2010 08:21 AM
05-06-2010 09:41 AM - edited 05-06-2010 09:43 AM
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
05-10-2010 04:21 AM
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