08-12-2020 04:11 AM - edited 08-12-2020 04:23 AM
I have a query here.
What if my Available Sample per Channel value is continuously in 500 range and it comes down to 0 and again goes back to 500 range. This phenomenon is happening continuously.
Does that mean my acquiring rate is too fast that in some of the iterations I am not getting any data and while other time data is available.
Also, as discussed in above post, what if the number keeps on increasing. What does it mean?
Does it mean that I have all data available but it is used too slowly in the program that my data in channel is continuously getting stacked.
Help me out with above queries.
08-12-2020 04:23 AM
Hi Aditya,
@AdityaAbhishek wrote:
What if my value is continuously in 500 range and it comes down to 0 and again goes back to 500 range. This phenomenon is happening continuously.
Which "value" are you talking about?
How are you reading the DAQmx sample data?
How did you configure your DAQmx task?
Mind to provide a VI demonstrating your problem?
In case you are talking about the "avaliable samples": why is it a problem to have ~500 samples available and sometimes just "down to 0"?
08-12-2020 08:24 AM
You still have not attached your code. We assume you know how to properly code simple DAQmx tasks, but this assumption appears to be false. We can "guess" what you are doing that is not correct, but that is a waste of our time, and also a waste of your time.
Please attach the VI (not a picture of the VI), or, much better, compress the Folder containing your entire LabVIEW Project and attach the resulting .zip file. We should quickly be able to find your mistake and explain to you how to properly code DAQmx to get the results you desire.
Bob Schor
08-12-2020 10:46 AM
I can't share the code as I don't have access to it. Although, I can share the picture of it.
The above picture can help you out.
08-12-2020 10:49 AM - edited 08-12-2020 10:52 AM
PFA
08-12-2020 01:20 PM
Hi Aditya,
so first you read samples from DAQmx, emptying the DAQmx-internal sample buffer, then you read the number of available samples.
And now you wonder why sometimes the buffer is reported empty AFTER you read the samples from the buffer!?
08-12-2020 10:12 PM
Hi GerdW,
It's means I am programmatically doing correct. And this is how I should read the DAQ internal buffer. Also, if even eat after reading the buffer, the samples keeps on increasing, then I am not reading complete buffer at a time and I need to increase the rate.
Regards,
Aditya
08-13-2020 09:47 AM
Hi GerdW,
What is correct rate of DAQ aquiring?
Is after reading the DAQ, my Available Sampling Value should come to zero and again fill to same range of value OR if it should remain at same range of values continuously. Overall, it should never keep on increasing as it will lead to Buffer overflow.
I am asking this query because I have observed that after 2-3 hours of program running, all of a sudden this value starts increasing at a very fast rate.
Can some one guide what can be possible issue. Please refer the pictures shared earlier for code.
Thanks & Regards,
Aditya
08-13-2020 11:14 AM
Usually when tasks run fine for quite a while and then suddenly cascade into a buffer overflow error, there are some bad coding practices to uncover and fix. One example is an array that can grow without bound -- eventually it becomes time consuming to allocate new memory, and so the app gets stuck and doesn't call your DAQmx Read function as often as it needs to.
Over the long haul, it's necessary that your application retrieves data from the buffer (via calls to DAQmx Read) at the same AVERAGE rate as the hardware sample rate. In the background, the DAQmx driver manages the process of pushing data *into* the buffer from the device., and that's getting pushed in, on AVERAGE, at the hardware sample rate as well.
Think of a boat with a slow leak. Water is constantly trickling into the boat at a regular rate. This is like DAQmx pushing data into the buffer. You're in the boat with a 5 gallon bucket. Every once in a while, you scoop up a few gallons of accumulated water and dump it over the side. If the leak flows in at 1/60 gallon per second then you need to dump water at a gallon per minute to keep up. This is like your application. You need to remove data from the buffer at the same average rate it's coming in, without every having a long enough idle period for the buffer to overflow (or the boat to sink).
-Kevin P