Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

error -200222

I cannot find information in help or manuals about this error. How can I know more about this? How can I avoid it?

Thanks and regards
Antonio López
0 Kudos
Message 1 of 6
(5,162 Views)
NI-DAQmx errors usually do a pretty good job explaining how to avoid the error.  If you are doing proper error handling you should receive the appropriate messages.  I typed the error code "-200222" into LabVIEW's explain error dialog (In LabVIEW goto Help>>Explain Error) and got the following:
 
Acquisition has been stopped to prevent an input buffer overwrite. Your application was unable to read samples from the buffer fast enough to prevent new samples from overwriting unread data.
To avoid this error, you can do any of the following:
1. Increase the size of the buffer.
2. Increase the number of samples you read each time you invoke a read operation.
3. Read samples more often.
4. Reduce the sample rate.
5. Change the data transfer mechanism from interrupts to DMA.
6. Reduce the number of applications your computer is running concurrently.
In addition, if you do not need to read every sample that is acquired, you can configure the overwrite mode to overwrite unread data, and then use the Relative To and Offset properties to read the desired samples.
 
If you need additional help, you might want to mention a few additional things.  Like what software & hardware you are using.  What is the general nature of your application.  You might also want to post your code.
-Alan A.
 
0 Kudos
Message 2 of 6
(5,148 Views)
Hello Alan,

thanks for your answer. I´m sorry I didn´t provide enough details.

I´m using MDAQ 6220 and 6221 to control a laser system with LabView 7.1. My problem is related to measure the line speed. I have an encoder on the line, and I measure the frequency of the signal generated by the encoder. I have to control the laser power as a function of the speed and the output power. I´m including the labview code (see a red box around an express vi).

I have, at random times, error -200222 (Acquisition has been stopped to prevent an input buffer overwrite). If I change the overwrite mode to allow overwrite, the error changes to -200141 (Data was overwritten before it could be read by the system). In both cases data acquisition stops, and this is a big deal because I´m starting tomorrow a live pilot with the system, 24x5.

I got that information about the error (but I didn´t know about LabVIEW's explain error dialog, that´s a good tip) when it arised on screen. What I would like to know is more details about it, to understand it and be sure (if possible) that data acquisition is not going to stop.

I tried solutions 2, 3 and 6. They didn´t fix the problem, I still have the error sometimes...

1. Increase the size of the buffer.
2. Increase the number of samples you read each time you invoke a read operation.
3. Read samples more often.
4. Reduce the sample rate.
5. Change the data transfer mechanism from interrupts to DMA.
6. Reduce the number of applications your computer is running concurrently.

About the other solutions:
1. How can I increase the size of the buffer? Is it possible to monitorize the buffer utilization? I don´t know much about the buffers...
4. I think I cannot do this, I´m measuring frequency with a counter, the timing is implicit and depends on the frequency of the input signal. Please let me know if I´m wrong.
5. I think I´m using DMA already (isn´t it the default?) How can I be sure about that?


Best regards, and thanks in advance.
Antonio


0 Kudos
Message 3 of 6
(5,131 Views)

Hi Antonio,

I agree with Alan - it might help to see your code to see if there is a better way to do your measurement. 

How often do you need to measure the speed up the laser using the encoder?  Once per second, once per millisecond, or as often as possible?  If you need to measure the speed and produce a new output every once in a while, then you may be able to throw away some samples.  With DAQmx you can do this by setting your OverWrite mode to "Overwrite Unread Samples" using the Read Property Node.  An even better way solution is to slow down your acquisition rate somehow so that additional samples do not fill up your buffer. 

It is possible that a buffered (continuous) acquisition is not the best way to control your laser.  This is because when you read samples from a buffered acquisition, you are not reading the current value.  Instead you are reading a value that may have been captured a while ago (depending on your acquisition speed and how far you are behind).  Also, it sounds like you want to measure just one sample of your laser speed during every iteration of your control loop.

For control loops I usually recommend the Hardware Timed Single Point (HWTSP) timing mode with fixed sample clock signal.  To use HWTSP, change your task timing from "Continuous" to "Hardware Timed Single Point".  Another possibility is to use software timing (to use software timing, simply don't use the DAQmx Timing VI) and control your loop rate using a LabVIEW timer.  Keep in mind that with either of these mechanisms you are still going to need to slow down your sample rate so your control loop can keep up.  If you are using Microsoft Windows, you will see a lot of jitter due to the operating system so you may need to reduce your rate by a lot.  Expect to be able to keep up at somewhere between 2 and 1000 samples a second, depending on the jitter of your system.  If you are using a LabVIEW Real-Time system, then you should be able to keep up at a fairly quick rate (perhaps more than 10000 samples per second).

- Jonathan
0 Kudos
Message 4 of 6
(5,117 Views)

-200141 is specifically a counter overflow (kErrorCounterOverflow) and corresponds to a gate error. Your encoder output is connected to PFI9? Encoder signals are often noisy. Noise on the line could cause this error.

To see if you are using DMA to transfer data from ctr0 to your application, examine the Data Transfer Mechanism. It's on the channel property node under Counter Input: General Properties: More: Advanced:Data Transfer and Memory:Data Transfer Mechanism. You appear to have two timed tasks on that board. Most DAQ boards have three DMA channels and both your tasks would use DMA by default. Some boards only have one DMA channel. If you have only one, force your AI task to use interrupts by setting its Data Transfer Mechanism. You are only taking 90 points and that will fit entirely in the board's fifo so the transfer mechanism isn't very important there.

0 Kudos
Message 5 of 6
(5,108 Views)
Hi Thayles, thanks a lot for your help.

Some comments:

- Yes I´m using PFI9 for the counter input. But the problem arises also emulating the encoder with a frequency generator, much less noisy.
- I´m using DMA (thanks for the indications to find it), and my cards are M series, therefore they have (by the M series whitepaper http://digital.ni.com/worldwide/latam.nsf/87e62f4c89ea9df9862564250075e6e4/b7b55c655b02a43d86256f7a00663d7e/$FILE/M%20Series%20White%20Paper%20-%20SP.pdf) 6 DMA channels each. So my problem shouldn´t come from that.

I´m using a 100ms wait time in the loop with the error, and windows XP. Could it be an operating system issue? Maybe raising the wait time to 250ms could help?

Regards
Antonio
0 Kudos
Message 6 of 6
(5,090 Views)