05-25-2016 08:30 AM
Hello,
I use a flow sensor that creates a frequency output, and connected that to my PCI-6035E. When I run it, it works for some seconds, and then gives an error. Error 200141 'Data was overwritten before it could be read by the system.' I also tested with a pulse generator instead of the flow sensor, and the error only occurred when I changed the frequency. How can I solve this prolem?
Thanks in advance!
Solved! Go to Solution.
05-25-2016 08:41 AM
First of all, there is no error code 200141. [Hint -- the minus sign is highly significant]. Second, what do you know about the input signal? And do you know if your hardware is working? Can MAX read the counter properly?
Bob Schor
05-25-2016 08:51 AM
Hi Bob,
Yes, the error is indeed -200141.
The input signal is between 2 and 600Hz. The hardware is working, I tested it on the test panel in MAX and it worked.
05-26-2016 03:04 AM
I'm still stuck here. Does anyone know how to solve this problem?
05-26-2016 07:38 AM
So much gets "buried" when using the DAQ Assistant -- it is a simplified (some might say "simple-minded") approach to getting started with DAQmx, but is a form of "blunt instrument". You need a scalpel to "dissect" your problem. If you type "Learn DAQmx" into a Google search, you will find lots of excellent material, including (the second hit when I just did it) my favorite NI White Paper, Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications.
Once you have "real" DAQmx functions, you can start debugging the process using probes, Highlight Execution, and other things to see where you might be going astray. If you are still having trouble, post the non-DAQ Assistant version for us to examine.
Bob Schor
06-03-2016 05:50 AM
Thank you for your replies, Bob.
I got it working now, the problem was that I was using continuous samples. I now take a single sample with a while loop and it works.
08-05-2020 08:54 AM
@Allard171 wrote:
I got it working now, the problem was that I was using continuous samples. I now take a single sample with a while loop and it works.
What are you doing with your data in the While Loop after you take it? Are you processing it (FFT, filter)? Are you plotting it? Are you doing anything that might take a substantial amount of time?
Let's assume that you are sampling 1000 samples at 1 kHz, a process that takes 1 second to complete. Let's also assume that you want to do some computations and then plot those 1000 sample, and lets say this take 0.1 to 0.5 seconds. Let's look at some timing:
The solution to this dilemma is to move the processing, which takes time, out of the Sampling Loop and into a parallel Loop that does only the processing, something that has the name "Producer-Consumer Design Pattern". Here's the Idea:
So it is possible to "have your cake" (take data continuously) and "eat it, too" (display, process, or otherwise handle the data).
Bob Schor