A Producer/Consumer architecture will certainly do the trick for you. I am sending you an example that has the Data Acquisition section in the producer loop. However, you can also put your User Interface in the Producer loop and have the Data Acquisition in the Consumer loop. The Queues are used for sending data from the Producer to the Consumer(s) loop(s) (you can have multiple comsumer loops).
You will just have to design specific cases to react to different user inputs.
By the way, this example is from LabVIEW Basics II training course. If you have never taken LabVIEW Basics I and II, I highly recommend them. You can self-pace the class or take it with an instructor.
Hope this helps!
Message Edited by Kalin T on 03-23-2007 09:57 AM
I like the Implemented producer consumer.zip example. This does acquisition in the producer loop and writes to the file in the consumer loop and the data is queued here. I was wondering if someone could help me with tweaking this code. I only want the data acquisition to start when I press a start button, however this program starts when someone runs the program directly. I know this may be possible to do with event structure, but am not sure how to tie it up with this program. I would appreciate any help in this regard.
I was also wondering that for data acquisition where some Front panel events may happen, what architecture is good to use. Is it ok to use a producer consumer with events where the events got in a event structure which is the producer, and consumer will be a state machine which will take care of the data acquisition. The data acquisition will be continuous so was not sure how to do the consumer loop with state machine. I would appreciate any help in this regard.
I am having trouble with my code. Can you take a look at the attached. I keep getting error messages when I try to run. They read "Compile error. Report this problem to National Instruments Tech support. ufppushop err, c=0x21" and also "merge ufp inconsistent state, n=1 x2"