LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increment an array using an event structure

Solved!
Go to solution

Hello,

I would like to increment a numeric indicator on the front panel using an event structure ("Key Down" and "Key Up") when the space bar is pressed. I have the event structure set up, however, I'm stuck on how to show the total number of key presses in real time. 

0 Kudos
Message 1 of 6
(3,352 Views)

You need to accumulate the count in a shift register or feedback node, then connect the indicator to its wire.

 

Please attach a simplified version of your code so we can give more targeted advice.

0 Kudos
Message 2 of 6
(3,344 Views)

It would look something like this.

Demo.png

 

Tim
GHSP
Message 3 of 6
(3,302 Views)

Hi,

 

         Check the attached vi.

Message 4 of 6
(3,293 Views)

@Liddy wrote:

Hello,

I would like to increment a numeric indicator on the front panel using an event structure ("Key Down" and "Key Up") when the space bar is pressed. I have the event structure set up, however, I'm stuck on how to show the total number of key presses in real time. 


Where does the array from the title ("Increment an array using an event structure") come in?

0 Kudos
Message 5 of 6
(3,280 Views)
Solution
Accepted by Liddy

If you want to increment the count for key down and key up (which lets you even determine if it is currently up or down by looking at even/odd of the count ;)), I would probably do something like the following.

 

SpaceUpDown.png

Message 6 of 6
(3,275 Views)