05-20-2011 10:51 AM
Hi
I aquire signals from PCMCIA and USB NI cards, now I want to control the input data by means of a start /stop button, so, this is a good way to make a Panel Control (Starts and Stops button)???, because I use a while loop inside a while loop, and I dont know if this make more slowly my program. What advice can you give me
please someone can help me??
05-20-2011 11:31 AM - edited 05-20-2011 11:34 AM
At a minimum I recommend you look at using an event structure. The event structure goes inside a while loop and its purpose is to catch UI events (such as a button press). This is a cleaner way to look for button presses than simply polling them. A better approach would be to look at the examples for a producer/consumer architecture. This generally consists of two loops. One loop contains the event structure to process UI events. You can also create your own events (user events) if necessary. The second loop uses a queue and a case statement. This loop is basically a state machine design which does the actual processing. For example, when the start button is pressed you would have an event (Value change) for the start button. This would queue up a message for the consumer loop to begin processing. Similarly you would handle your stop event when the stop button is pressed.
Also, for performance purposes you may want to consider only starting your DAQ tasks once. When collecting your data do only that. It is not necessary to create and destroy the DAQ tasks every time you perform a data collection.
05-23-2011 06:24 AM
Please, you have un example.
thanks so much
05-23-2011 09:12 AM
Here is an example:
Paul
05-23-2011 09:27 AM
I'm really sorry ; but can you post your VI in labVIEW 2009
Thanks
05-23-2011 10:20 AM
Take a look now. I downgraded it for 2009.
Just an advice: you can change the String from my VI with queue. It works also this way and it's easier to be understood by beginners.