LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a user event when push button is pressed

Solved!
Go to solution

I have a program where I have a push button connected to NI DAQ and when button is pressed the DAQ reads it. Until the reading part the program is fine. When the push button pressed, a true variable will come out of the DAQ read and is given to a case structure. Inside the case structure, a generate user event is wired with a true variable and this is then given to register to user events and finally to the event structure. Inside the event structure, a boolean is wired. 

Push Button User Event.jpg

You can see what I explained in the picture above. I have also attached the VI. When I run the program and pressed the push button, nothing is happening. So I ran it in highlight execution mode and I see the user event Push Button Pressed is never executed inside the event structure, but the true case of the case structure is executed which will generate a user event. But it is not executed in the event structure. Why is this happening? Thank you. 

0 Kudos
Message 1 of 3
(429 Views)
Solution
Accepted by topic author govindsankar

Sorry, the program is wrong. I used the register for user event in the wrong way. I correct it by watching a youtube video. Here is the correct solution. 

Push Button User Event.jpg

 

Message 2 of 3
(425 Views)

@govindsankar wrote:

Sorry, the program is wrong. I used the register for user event in the wrong way. I correct it by watching a youtube video. Here is the correct solution. 


Yes, in your first one you send the event before you've registered it and started listening, thus no reaction, and since you reregister i assume the same happens every time.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(331 Views)