Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Data written / Read from the system

Hello
 
I am using PCI 6602 with Daqmx driver and written a program for buffered event counting with trigger and pulse generation using Visual Basic 6.0. When i choose 20 MHz as pulse generation frequency with 8000 channels, I am getting an error when the counting process is going on as :
 
"Data Was written before it could be read by the system. If Data transfer mechanism is interrupts try using DMA, other wise divide the input signal before taking the measurement".
 
 Same is working fine with traditional DAQ driver. Is anything to be set so that it will produce an delay?
 
Have attached the program for reference with the parameters set to it.
 
 

Message Edited by Support on 07-13-2007 01:27 PM

0 Kudos
Message 1 of 9
(5,192 Views)
Hi Rajaram,

Thanks for posting your query on the National Instruments forums. Do you have an error code associated with the error message? Are you able to tack down at what point in your code the error is generated?

Please see the following KB article:

http://digital.ni.com/public.nsf/allkb/A696607CD6864B568625692E004A9316?OpenDocument

All the best

Kirtesh Mistry
Applications Engineer
National Instruments UK & Ireland





0 Kudos
Message 2 of 9
(5,178 Views)

Hello,

Thanks for your response. Error code I am getting is 200141, I am afriad it is due to the DMA functionality of the card. I have attached the screen shot of the error and it is not occuring consistently with number of sweep. It is dependent on when the data is written before the system reads the previous sweep (buffer) data. From the link, I can see for finite buffer maximum pulse period  is 7.5 MHz, I am generating a pulse with 2 MHz and I suppose there should be no problem. And other point is I have tried the same freq (2 MHz) in traditional DAQ and no error comes up with respect to DMA. In face it is using the same system resource when using both drivers.

 

Thanks

Rajaram

Download All
0 Kudos
Message 3 of 9
(5,172 Views)
Hi Rajaram

This results from the fact that the counter FIFO size is only one sample, so that error -200141 is thrown if two consecutive samples infringe the specs. Example: A 10,000 sample buffer should handle 2.0 MS/s according to spec, which means that two consecutive signal edges must have a time interval of at least 500 ns.

What version of the NI DAQmx driver are you working with?

Kirtesh Mistry
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 4 of 9
(5,169 Views)

Hi

I am using NIDAQmx 8.3

Language used: Visual Basic 6.0

Hardware: PCI 6602

 

Thanks

0 Kudos
Message 5 of 9
(5,164 Views)
You can create a digital lowpass filter by means of a second counter to ignore any signal edges arriving in a specific time interval. I have an example of this in LabVIEW - not so sure about VB.

Kirtesh Mistry
Applications Engineer
National Instruments UK & Ireland.
0 Kudos
Message 6 of 9
(5,163 Views)
Hello
 
I have not foung any digital low pass filter properties in C reference help of DAQmx, I can see Analog Low pass but not the digital one. In my code I have enabled Synchronous (Duplicate) counting.
 
Thanks
0 Kudos
Message 7 of 9
(5,161 Views)
Hi,

Using ANSI C:
The NI-DAQmx C API has properties which can be set to enable the digital filters depending on the type of Counter Input task. For example, to enable the digital filter for a Counter Input Frequency task, you would use DAQmxSetCIFreqDigFltrEnable to enable the filter and DAQmxSetCIFreqDigFltrMinPulseWidth to set its minimum pulse width. To use a programmable filter setting with the same type of task, you must use DAQmxSetCIFreqDigFltrTimebaseSrc to set the source of the filter clock and DAQmxSetCIFreqDigFltrTimebaseRate to specify its rate. For more information on how to use these functions, see the NI-DAQmx C Reference Help at Start » Programs » National Instruments » NI-DAQ.

I hope this helps!

Kirtesh Mistry

0 Kudos
Message 8 of 9
(5,156 Views)
Hello
 
I tried to use Digital filter DaqmxSetCIFreqDigFltrEnable and DAQmxSetCIFreqDigFltrMinPulseWidth, but getting an error as task not supported. Is there any other way to work around the DMA problem?
 
Thanks
0 Kudos
Message 9 of 9
(5,136 Views)