Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

some problems about PCIe6537card

Hi all:

 

I have some problems with Pcie6537card.未命名.jpg

 

 

I use this card to collect date in a while loop,and i need do some process to the data in the loop.

some times the process takes to many time than there will be a error in the  next round of the loop which says :

 

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

 

i think these three ways to solve this problem is not so good. They only reduce the probability of the error.

 

I use a "daqmx read property"before "daqmx Start Task",  and set the "overwrite" to "Do not overwrite Unread Samples" Then there come out another problem:

after the program runed a while,there will be on data come into the while loop,so there is no data come out from the "daqmx Read" in  the while loop. and this phenomenon will continue untile you rerun the program.

 

hope you can give me some suggestions! thanks!

0 Kudos
Message 1 of 3
(2,919 Views)
Can you post your vi?
0 Kudos
Message 2 of 3
(2,913 Views)

Actually, I think the second solution that the error message proposed might be the key here: reading the data more frequently.

 

As you identified, the amount of time spent doing the processing in the loop is taking too much time such that DAQmx Read is not called often enough.  You might find it useful to use a producer-consumer model here where you have two loops and a queue.  The first loop (producer) reads from DAQmx Read and enqueues the data.  The other loop (consumer) dequeues and then performs the processing on the data.  The advantage here is that you can process data while DAQmx Read is being called.  By taking advantage of the parallel processing, you might be able to overcome the performance issue here.  For an example of producer-consumer in LabVIEW, select File>>New and browse to VI>>From Template>>Frameworks>>Design Patterns>>Producer/Consumer Design Pattern (Data).

 

Additionally, do not read for -1 if you're running into performance problems.  Reading for -1 will immediately return with whatever samples are available.  Many times, this can be very small (like 10 samples).  When you read and process a small amount of data, you maximize the effect of function's overhead.  This can hurt performance.  Instead, pick a value that is (for example) 1/10 of your rate (if you are reading at 10k, read 1k samples each time).

 

These two things should improve your performance and perhaps solve your issue with not keeping up with your device.

Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 3 of 3
(2,904 Views)