LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Handling with Keyboard Presses

Solved!
Go to solution

Hi there,

 

This appears to be a very basic question but just can't wrap my head around the solution.

 

The attached code should stop the program upon seeing "Escape" on the keyboard.

 

It sees that the keyboard is pressed and the "Esc Pressed?" indicator is ON.

 

However, the Event structure does not acknowledge a Change in Value of "Esc Pressed?". I believe this is because the indicator array size is nulled when nothing is pressed as opposed to being 0.

 

Is there a way to overcome this issue? Note, I don't want to use Case structures for this.

0 Kudos
Message 1 of 2
(885 Views)
Solution
Accepted by topic author SDuffyLV

Hi Duffy,

 


@SDuffyLV wrote:

However, the Event structure does not acknowledge a Change in Value of "Esc Pressed?". I believe this is because the indicator array size is nulled when nothing is pressed as opposed to being 0.


Learn the basics of events in LabVIEW!

Writing to a terminal of an indicator DOES NOT generate a ValueChange event!

 

Why don't you simplify your VI like this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(879 Views)