07-24-2006 08:41 AM
07-24-2006 12:58 PM
Ehat are you doing with the data, what language (LV?) are you using. Usually the slowdown of a DAQ loop is due to a buildup in an array when the data is collected, for this reason I usually suggest a producte, consumer model architecture where the daq and processing are seperated. If you are passing the data out of a (while) loop using autoindexing, the memory is constantly being reallocated as the array grows so your loop will slowdown the application. Please give a little more detail apout your application.
Paul
07-25-2006 02:26 AM
07-25-2006 07:21 AM
I dont have supporting hardware so it would be hard to debug the code but one thing you could do is to move the daq to its own loop and queue up the signal out, in a seperate loop you can have your analysis nad presentation, running on the dequeue operation. For the daq you can then configure it to rut at 10Hz continious and buffer every 10 points to send to the queue, this should be better than taking 1 point at a time 20 times per second. You should also use the vi profiler to see where the bottleneck is. The common sources of the bottleneck would be in the display (displaying lots of data can slow down the loop) or in the write to file (which can be postponed to run at less often intervals.
Paul
07-25-2006 07:27 AM
07-25-2006 09:15 AM
07-26-2006 08:40 AM
07-26-2006 12:22 PM
The profiler works as follows, open the profier, hit start (you can get the timing details and switch to microsecond timing if needed) THEN run the vi, hit snapshot periodically to see how the timing (look for the slowdown) of the SUBVIs to fiind the bottleneck. As for the producer consumer loops, you need not use the error condition as the stop, it is like any loop, it can take a Boolean. Typically the consumer loop does work on the error condition of the shared queue so that after the producer is done producing (ie data collection is terminated) the queue can be killed and the consumer will terminate.
Paul
07-27-2006 07:02 AM
07-27-2006 02:57 PM
Hello Catherine,
Paul's suggestion to use a Producer/Consumer architecture is a good idea if you would like to process and display a large amount of data. The Producer loop will add the data to the queue and the Consumer loop can take that data out of the queue and analyze it, write it to file and/or display it. The two loops are not dependent on one another so if the part of the program that manipulates the data takes a long time, it will allow your program to continue acquiring and queuing up the data without slowing the acquisition or Producer loop down.
In the case of using the DAQ Assistant, this would be placed inside the Producer loop and the data (dynamic data) would wire to the 'element' input of the 'Enqueue Element' function. That data would then be available in the Consumer loop when it gets dequeued. The data would again be a dynamic data type as it comes out of the 'Dequeue Element' function as 'element'.
The portion you see outside of the Producer/Consumer loops is simply to create and destroy the queue and you must specify what kind of data you will be placing into the queue. This data type is wired to the 'element data type' terminal of the 'Obtain Queue' function.
Hope this clarifies the use of the Producer/Consumer structure.
Regards,
Jennifer O.