LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event programming (continuous run)

I'm developing an application that runs continuously, and has three buttons, corresponding to three different actions. I have used an event structure, and defined different cases, to be executed when the button values change. The problem is that while is waiting for an event, I need the application to keep on running, not to be waiting. Hay can I solve this problem?
0 Kudos
Message 1 of 4
(2,789 Views)
Without knowing your exact application I can think of two simple ways that might work. First, you can put the event structure in a parallel loop with the rest of the structure. This will do exactly what you are asking for. However, now you have to be careful in your programming in terms of how you transfer the new values from one loop to another.

A second method that could be useful is to have an event structure with a short timeout. This will limit the amount of time that is spent waiting on the event structure during each iteration of your program. This method is easier in terms of data transfer but loses some of the advantages of the event structure. In most cases I would prefer the first option.
Message 2 of 4
(2,789 Views)
Thank you very much, at the moment the first option works properly. what happens if I want to include a timed loop in the same while look that has the event structure? this timed loop is supossed to refresh a graph each 1second, while waiting for events. I have tried to include it and I have had some problems
0 Kudos
Message 3 of 4
(2,789 Views)
While it's not clear as to exactly how your program is set up, you will clearly experience difficulties with this type of setup. I suggest that you utilize the Timeout of the Event structure as your timed loop. If you'll set the timeout to 1000 ms and put your code to update the graph inside the event structure you should get the results that you desire.
0 Kudos
Message 4 of 4
(2,789 Views)