Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

VI slows down data collection after 120 seconds

Hello,

I have a program using a DAQ that is taking in data from 31 channels.  I want the data to be collected every 0.1second.  After  about 120 seconds, the Loop slows down and data is no longer taken every 0.1 seconds.  I have tried time delay and wait functions and I have no Idea how to fix it.  I need the data to be collected at the same speed for long periods of time.

Any help would be much appreciated.
Thank You
Catherine
0 Kudos
Message 1 of 15
(5,331 Views)

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

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 15
(5,320 Views)
Paul,

Thank you for your reply.  I have attached my program.  I would like the serial number to be 10 times greater than the time output for long periods of time.  In the program, the serial number does not increase as fast as the time does, as time goes on.  I am not sure how to fix this.

Thank You
Catherine
0 Kudos
Message 3 of 15
(5,310 Views)

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

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 15
(5,306 Views)
Thank you for your reply, but I am new to labview and have NO idea what some of these things you are talking about are.  I know how to put it in its own loop but what is "queue up the signal out" and "send to the queue",  And how do I use a vi profiler?

Thank You
Catherine
0 Kudos
Message 5 of 15
(5,305 Views)
for queuing see the producer/consumer design pattern (under vi templates>>design patterns).  For vi profiling, select tools>>advanved>> profile_vi, this will allow you to see the memory and execution speeds of all vi and subvis in an application for bottleneck and performance profiling.  I can send more information late today.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 15
(5,301 Views)
Hello again,

I opened up the profile_vi, and ran it and all 0's showed up.  How am I supposed to use this to help me?  And I am a little confused about the producer/consumer loops.  Don't they all run on error?  Do i hook my error up to it or my signal?

I am sorry, I am very new to all of this and really confused.

Thanks
Catherine
0 Kudos
Message 7 of 15
(5,290 Views)

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

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 15
(5,285 Views)
Hello again,

Thank you for your help.  I tried using a producer/consumer loop.  I don't think it is possible to do that with a DAQ.  I don't know what I would use as the queue.  I can't have the DAQ outside the consumer, and I don't know what I would hook up to the queue if it is inside.  Maybe I am doing something wrong?  I think I am trying to output too much maybe.

Catherine
0 Kudos
Message 9 of 15
(5,269 Views)

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. 

0 Kudos
Message 10 of 15
(5,260 Views)