From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DataTransferMechanism

Hello, 

 

we're using the NI PCI 6602 card in combination with the C Library and trying to read 6/7 counters at a  time. Because the device has just three DMA-Channels we're setting some of the counters to DAQmx_Val_Interrupts using DAQmxSetCIDataXferMech(). The counters are read using DAQmxReadCounterU32(...) for every single one. The program starts properly and reads the data for some time (between 10sec and 1min) and then suddenly the conuters stop counting up and we don't get anything out from the card until we restart all the task. You'll find attached a sample test project. Could you tell us what might be the cause of it?

 

thank you very much,

 

our test-environment:

NI PCI-6602 with NI-DAQmx 9.8 Driver, Intel Core i7-3610QE, 16GB Memory, Visual Studio 2010 SP1, Windows 7/8

0 Kudos
Message 1 of 8
(5,575 Views)

Hi muskurov,

 

I looked into your code and I was wondering if you get any kind of error code when using DAQmxErrChk? That should help determine the reason of the described behaviour.

 

In addition to that it seems that you have a sampling rate of 16 kS/s  respectively 16 kHz, but you only get 1 Sample out at a time. (marked with red font color) Perhaps you get a buffer overflow, but a error code could confirm that easily.

 

DAQmxCfgSampClkTiming(taskHandle2B,"/Dev1 PFI2",16000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1));
DAQmxReadCounterU32(taskHandle1A,1,0,data1a,1,&read1a,NULL);

 

By the way you tell the DAQmxReadCounterU32 function that the array you provide for data storage has the length 1 although you initialized the array with 100 (marked with purple font color).

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 2 of 8
(5,548 Views)

There must be some error while setting up the cords. you must check that if this does not set up again than you should give it of repairing job or cal the operator.

0 Kudos
Message 3 of 8
(5,539 Views)

the error message is: "Data was overwritten before it could be read by the system"

I've tested it with different sample counts and sampling rates, always the same result.

0 Kudos
Message 4 of 8
(5,532 Views)

Hi muskurov,

 

have you seen the following article yet?:

 

Error 200141 Occurs When Doing Buffered Event Counting - National Instruments
http://digital.ni.com/public.nsf/allkb/83656593DCF1FB0F862570B6004D7222

You only wrote that you tried different rates. Could you just test the following proposal:

 

DAQmxCfgSampClkTiming(taskHandle2B,"/Dev1 PFI2",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1));
DAQmxReadCounterU32(taskHandle1A,1,0,data1a,100,&read1a,NULL);

 

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
0 Kudos
Message 5 of 8
(5,521 Views)

Hello Christoph, 

 

Thank you for the response, yes I did come to the article earlier, but it didn't help much.

We've tried your suggestion, but still after a few minutes error 200141 occurs.

 

I'm now certain that it has to do with the OS as when I minimize the console/window it's almost certain to fail reading and come up to 200141, which is rather strange for me.

 

best regards,

kalo

0 Kudos
Message 6 of 8
(5,502 Views)

Hi kalo,

 

ok that makes sense. If your OS lags the experienced behaviour could occur. Could you check your program with a faster / more responsive computer, perhaps with less background services/programs.

 

Regarding the possible sampling rate with interrupts this post could prove interesting for you:

 

Re: -200141 Data was overwritten before it could be read by the system. If Data Transfer Mechanism is Interrupts, try using DMA or USB Bulk. Otherwise, divide the input signal before taking the measurement. - Discussion Forums
http://forums.ni.com/t5/Counter-Timer/200141-Data-was-overwritten-before-it-could-be-read-by-the/m-p...

Best regards,

Christoph

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
Message 7 of 8
(5,491 Views)

thank you for your replies Christoph. we didn't get it to work properly in Interrupts mode instead we'll be using two devices with all the counters on DMA.

 

cheers,

kalo

0 Kudos
Message 8 of 8
(5,435 Views)