LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show indices of Last TWO buttons pressed in a boolean array (how to?)

How would you go about showing the indices of the last TWO buttons pressed in an array of buttons, and only after TWO buttons have been pressed? I know how to show the LAST button pressed, and I know how to flag the event of two buttons being pressed (using the modulus), but I can't readily see how to show the indices of the last TWO.

For example, in an array of 24 buttons, someone presses buttons 2 and 7... an indicator says 2 & 7. Those buttons remain pressed. Now the user presses buttons 14 and 3, the same indicator now reads 14 & 3.

The indicator can be text, an int array, two ints, whatever. Any ideas?


Message Edited by LV_Addict on 07-28-2008 01:29 PM
0 Kudos
Message 1 of 4
(2,377 Views)

LV_Addict wrote;

"...  I know how to show the LAST button pressed, "

POst the code showing how you are doing this so we can offere suggestions.

Now speculating....

If your solution involves using a shift register, were you aware that you can drag down on the left hand SR and get access to history of what was placed in the SR?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,373 Views)
Thanks Ben. Smiley Very Happy


To get the LAST button pressed, I just XOR the array and look for the True, as shown. No biggie.

Yep, I know about the ability to expand the left side S/R to get a histogram, and have used that in the past. It doesn't seem to do anything for me here! Smiley Mad
0 Kudos
Message 3 of 4
(2,365 Views)
I'm thinking now, outside of work and no LV, that a small VI with uninitialized shift registers storing the last two button press indices might do it.   The S/R's on the main loop won't do it.
0 Kudos
Message 4 of 4
(2,329 Views)