LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic event registration

Hi all!

Basically, my application is a state machine that in one state, starts a loop to plot data into a chart, in paralell with the state machine.

To start the loop I'm trying to use dynamic event registration.

I read "http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/using_events_in_labview/", but, I was not able to make it work correctly.

The application and the loop finishes only when the user press a stop button.

I'm using random numbers function to simulate data aquisition

My VI is in the file attached.

Thanks a lot in advance for the help.

Regards, Roberto.

0 Kudos
Message 1 of 5
(2,344 Views)

I don't think that will work.  Instead, you should create user event and register event on the top, and generate user event on the bottom.  In your vi, you are changing value programmatically, and there is no event happening on the UI, so it won't work.  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 5
(2,340 Views)

jyang72211's solution is correct, to get things working with events.

 

Is there a reason you can't use a queue or notifier for the same effect? Creating a user event seems like overkill to me. A more traditional producer/consumer loop would give you more flexibility.

0 Kudos
Message 3 of 5
(2,328 Views)

Try to use the method below to see does it work. 

 

http://zone.ni.com/reference/en-XX/help/371361G-01/lvprop/ctrl_value_signaling/

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 5
(2,305 Views)

Hi all! Sorry for my delay to reply, but, I was trying the best solution to my application.

What was causing a problem in my application were two loops waiting for events running in parallel.

One loop was waiting for button events, while the other was waiting for the event created programmatically.

Now, the application is a state machine and in one state it uses a producer/consumer queue to trigger the loop to plot the main chart.

And then, in the following state, it starts a loop to wait for button events.

The file attached is the final solution.

Thank you all for the help.

Regards, Roberto.

 

0 Kudos
Message 5 of 5
(2,266 Views)