LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting error 200141 when counting pulses?

I am using a 9401 module in slot 5 of the compact DAQ 9172 chassis to count pulses.  About every 5th execution of my VI, I get error 200141: "Data was overwritten before it could be read by the system".  I am using a 100kHz clock rate.  I am using DAQmx VI's, not DAQmx base.  (I understand that there's a DMA issue with DAQmx base.)

 

Can anyone make a suggestion?  I have attached my VI.

 

Thanks in advance.

0 Kudos
Message 1 of 6
(3,272 Views)

Hi VI Joe,


Thanks for the post and I hope your well.

 

I have looked at your code and the error. I wondered if you were mainting the same configuration each time you run your code - the error would suggested your sampling rate is set too high. 

 

Do you see the same effect if you use one of the DAQmx Example in the NI Example Finder (help>>Finder Examples.. Hardware Input/Output>>DAQmx..)?

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 6
(3,236 Views)
I get the same effect when I run the task in MAX.  Intuitively, 100K doesn't seem to be too fast.  Is there a slower clock I can choose from?
0 Kudos
Message 3 of 6
(3,226 Views)

Hi Joe,

 

I went ahead and setup a 9172 chassis with a 9401 module in slot 5, and ran your code. I placed a while loop around the code and let it run for quite awhile without any trouble (see attached screenshot). I also ran a task in MAX (finite and continuous) many times without getting the error. I am not sure why your system is having trouble when using a clock rate of 100 kHz. Generally, the USB Signal Stream can transfer the data faster than that, though for some reason the 2 sample FIFO on your cDAQ chassis is getting overwritten faster than the USB can transfer the data. Do you have anything else running on the chassis at the same time or any other USB communication occurring such as with another DAQ device? The only time I have seen this error occur was when running a buffered edge counting task while synchornizing it with multiple analog input channels. I am also wondering if you can run the program on another system to see if the performance of the USB is better.

 

To answer your question about using a slower clock, there is not one you can directly choose such as the 100 kHz timebase, though you could provide a clock from another task (such as an AI/AO Sample Clock or from the other counter). I went ahead and created an example program which produces a pulse train on ctr1 and uses this as the clock for ctr0 (attached below). When running this code, I did not start to receive the -200141 error until I increased the clock to about 1 MHz. Hope this helps,

Daniel S.
National Instruments
Download All
Message 4 of 6
(3,216 Views)
I got my original VI to run on a different computer using the 80MHz clock.  I think the problem was the original computer was equipped with USB 1.0.  The second computer I tried was equipped with USB 2.0.  Does this sound reasonable?
0 Kudos
Message 5 of 6
(3,189 Views)

Hi Joe,

 

I am glad to hear that you got it working. It sounds like you were definitely running into some limitations of the slower USB bus. Thanks for the follow-up to let us know you got it working with the other system!

 

Regards,
Daniel S.
National Instruments
0 Kudos
Message 6 of 6
(3,184 Views)