LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

producer-consumer: optimize data acquistion rate

Solved!
Go to solution

I have a producer-consumer type of application in which one loop continuously reads data from the card and queues it and another loops reads/saves data. Additionaly one more loop plots the data. The number of channels and real-time analysis is defined by the user so the time it would take to save, display, and analyze each block (one iteration of Analog/Digital Read) of data may vary for different settings.

 

Currently I am setting the "number of samples to get" large enough on the Analog/Digital Read at the start so I don't get queue overflow. Now I would like to adjust it automatically while the program is running so I don't get any queue overflow and at the same time the data is not display in huge chunks at a time. Has anyone done this sort of thing before? Right now the only idea I have is to read the # of elements in the queue continuously and use some mathematical formula to increase or decrease # of samples.

 

0 Kudos
Message 1 of 3
(3,006 Views)
Solution
Accepted by topic author abdel2

Abdel2,

 

Reading the number of elements in the queue continuously and using a mathematical formula to increase or decrease the number of samples would be a great method. You could also use the Decimate 1D Array Function to display a smaller grouping of your data if your issue is that you don't want to display huge chunks of data at time.

 

Decimate.PNG

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Message 2 of 3
(2,974 Views)

Thanks Ben S. I think I'll pursue this then as soon as I get the time.

I am already decimating the data for displaying purpose, but not by using the "decimate array" function. I need to programmatically decide the decimation factor so I wrote a subroutine to do the job.

0 Kudos
Message 3 of 3
(2,906 Views)