LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between two event cases

Hi,

 

I am writing an event-driven program. There are two event cases. One initializes the DAQ parameters ("initialization" event). The other starts the acquisition of the data continuously ("acquisition" event). During execution, I always start the initialization event first, then go to the acquisition event.

 

Now I want the acquisition event to stop once I change certain values on the UI, for example, a parameter like "AO rate", and the initialization event to happen AUTOMATICALLY. What's more, once the initialization event is finished, I want the acquisition event to start automatically. 

 

I have been using statically defined events. After reading many posts on this board, I get the impression that a dynamically defined event structure may allow me to achieve above goal. However, I cannot figure out how to actually do it. 

 

Any suggestions or sample codes would be greatly appreciated!

0 Kudos
Message 1 of 4
(2,926 Views)

Hi Geena,

you can use the Producer/Consumer Design to realize what you want. Make the Consumer loop as a state machine. Send only commands from the event to "init", "start", "stop" or "reinit" your DAQmx device.

 

Mike 

Message 2 of 4
(2,903 Views)
Thanks! It works great.
0 Kudos
Message 4 of 4
(2,846 Views)