LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx buffer errors and data slow downs everywhere

I cannot seem to figure out what happened to my vi and why all of a sudden I am getting a buffer overrun error. It is attached.

 

This is the error I am getting


Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi

Possible reason(s):
Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

 

What I am trying to do is just read and plot the data as quickly and efficiently as possible with as high a sampling rate as possible. I tried to sample at a higher rate (1kHz) but then my data has giant gaps in it on my charts ( i am just reading a voltage though so I don't know why that would be the case) .  I added a buffer greater than 1000 samples, tried to change the sample buffer like the ni error article suggested and I can't seem to figure this out. all the daqs except for dev 5 are the same. 5 has 16 analog input channels but im only using 10 of them.

0 Kudos
Message 1 of 9
(2,425 Views)

1) Do not set the buffer size.  With continuous samples, it defaults to as much as the DAQ card can handle.

2) You need to read more than 1 sample at a time.  Reads 10 samples.  At 1kHz, that would be 10ms worth of data at a time.

3). You have a lot of processing and saving to disk happening in there.  Look into using a Producer/Consumer setup to put your logging to the TDMS file into another loop.  It won't slow down your reading from the DAQ that way.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 9
(2,423 Views)
Where would I set that read ten samples is that on the sample clock?

Ill try the queue system again but I couldnt get it to work last time. All of my data was out of order and mislabeled. What should it look like if I want the same tdms header sheet and column names like I have now?
0 Kudos
Message 3 of 9
(2,418 Views)

@labview12110 wrote:
Where would I set that read ten samples is that on the sample clock?

DAQmx Read.  You want Multiple Channels, Mulitple Samples.  Then there will be an input for the number of samples to read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 9
(2,416 Views)
Ive tried that before it took away my ability to perform calculations. Like say the color change loop. I want a 2d dbl for my data type yes?
0 Kudos
Message 5 of 9
(2,411 Views)
If I try a queue I cant use different data types it seems. Some of my inputs are strings and some are numbers. Do I make 3 different queues one for each data type?
0 Kudos
Message 6 of 9
(2,407 Views)

Yes, you will want a 2D array of doubles.

 

You could do your color calculations inside of two FOR loops (one inside of the other) or just take one sample out of the ones read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 9
(2,404 Views)
Giving it a shot right now. Am I splitting up my data to their respective graphs properly? With the subarray function now
0 Kudos
Message 8 of 9
(2,400 Views)

Attached is a new VI with a queue system. My only issue is that my data is not all present in the file and is out of order. I also did not get all of it in the spreadhseet.

0 Kudos
Message 9 of 9
(2,395 Views)