Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronize Reading of a quadrature encoder and analog input.

I need to synchronize analog data acquisiton with the reading of a quadrature encoder.
When my analog acquisition is running, I set up the counter as a buffered edge counting with the source of the sample clock "/Dev1/ai/SampleClock" (like in the example Count Digital Events-Buffered-Continuous-Ext Clk.vi provided with LV7.1).
When I started the buffered edge counting, I always obtain the error :
"
Data was overwritten before it could be read by the system.
If Data Transfer Mechanism is Interrupts, try using DMA. Otherwise, divide the input signal before taking the measurement.
"

Parameters for analog input :
Fs=100Hz
Number of points to read at a time : 10

Parameters for buffered edges counting :
Source of sample clock : "/Dev1/ai/SampleClock
Fs=100Hz
Number of points to read at a time : 10.

The hardware is a DAQPAD 6015, maybe, it 's the problem ?

any suggestions ?

Thanks in advance, for your help.
0 Kudos
Message 1 of 4
(4,054 Views)
Hi Nico,

I ran some tests with the VI attached below. I think that this VI does the same thing as yours.

With the daqpad 6015 you will never be able to get all the data at 100 Hz. I had to go lower than 50 Hz. I ran a test with a E-series card and there it works perfect at high sampling rates and with your settings.

This error you are getting is the one with code: -200141, right?

This is caused by a combination of factors including the DAQPad-6015 and 6016 have a very small FIFO for the counters, and they do not support DMA for counter operations. Therefore, the small buffer fills up very quickly causing the reported error. Below are some workarounds.

1) Use another DAQ device. This same code works just fine with a PCI E-series board, regardless of the data transfer mechanism (DMA or IRQ).

2) Acquire the counter signal with AI and do some post processing in software

3) convert counter signal to analog and read in using AI
http://www.miranova.com/Product/EI700.html#Anchor-Analo-63302
http://www.lt-automation.com/PositionTransducers.htm
http://www.deltacompsys.com/prods/motion/field/trans_quad.shtml
http://www.usdigital.com/products/edac/
http://www.usdigital.com/products/edac2/
http://www.usdigital.com/products/etach/

Regards.

JorisV
Message 2 of 4
(4,040 Views)
Hi,

I have a similar problem. I use a pci-6013 board to acquire 6 analog channels, one counter to measure frequency and another counter to count pulses. I use ni-daqmx driver.
When I'm just acquiring analog channels the program runs very fast and there's no problem. Tough when I acquire analog channels and counters my program runs very slowly and sometimes data is overwritten (error code -200279). Why does it happen?
I use DMA for analog inputs and Programmed I/O for frequency measurement.

Thanks in advance,
Leandro H. Batista
0 Kudos
Message 3 of 4
(3,999 Views)
Hello All,

In Joris's example VI I notice that the analog input task begins long before the counter task. You might consider calling *both* DAQmx Start Task VIs *after both* DAQmx Timing VIs have completed.

Regards,

Peter Blume
0 Kudos
Message 4 of 4
(3,985 Views)