02-16-2014 05:00 AM - edited 02-16-2014 05:03 AM
Hello,
I would like to have a vi to detect left, right and no mouse click. I mean that in the vi attached, Button2 should be 0 (no click), 1 (left c.) or 2 (right c.) depending on the event occured in i-1. cycle. My vi is the modyfied version of the one found here:
http://www.ni.com/example/27663/en/
Sometimes it works fine, but another time nothing happens when I click.
I think the main problem is with the execution times at the for loop and event structure.
Could you help me how to deal with the problem?
Thanks you!
02-16-2014 06:38 AM
Hi VampireEmpire,
Your For loop iterates twice. If an event occures during first iteration everything is fine - Button 2 refreshes during second iteration. But what happens when an event occures during second iteration? Does Button 2 have a possibility to refresh?
1. Do you see the problem now?
2. And if you do - do you really need For loop? I would suggest you trying removing it and connecting shift register to the while loop.
Bluesheep
02-16-2014 06:58 AM
Hi Bluesheep!
Thank you for your fast reply! Now it works fine.