01-17-2013 02:08 PM
Hi all,
I'm trying to create a safety sequence where two keyboard buttons have to be pressed simultaneously and held for a set time before a true condition is set for a process to occur.
I've attached a vi with my trial. Currently, only one button press registers(only one indicator lights up) instead of both keys. I've tried using two seperate loops (one for each key) but that resulted with the same results. I've inserted a 3 second wait before the loop to give time for the user to press the z and / keys.
Any suggestions would be greatly appreciated!
Thanks,
Chris
Labview version is 8.6
Solved! Go to Solution.
01-17-2013 02:21 PM
If you want both buttons pressed at the same time, you shouldn't be indexing out the first key. Instead, use the Search 1D Array to see if a z was pressed. Do the same for the /. If both of them are found (index >=0) increment a counter. If one of them was not found (index < 0), reset the counter to 0. Set a loop rate to something like 50ms. So if your count gets to high (3 seconds/50ms/loop = 60 loops), you can exit and do your sequence.
01-17-2013 03:25 PM
01-17-2013 05:29 PM
Thank you both!