Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ to DAQmX problems with analog input sample rate

Hi,

 

I am trying to migrate a code from NiDAQ (legacy) to NiDAQmX and I am having a problem with the analog input.

I am using a PCI MIO 16e 1 (that has maximum adq. rate 1'25MHz).

 

Using NiDAQ (legacy) I read from two input chanels using:

 

i16 status = DAQ_Rate(m_AdqFM, POINT_SEG, &m_AdqBaseT, &m_AdqIntT);
SCAN_Setup(DEVICE, 2, m_AdqNumCanal, m_AdqGanCanal);
i16 status = SCAN_Start(DEVICE, rawDatai16, m_AdqNM * 2, m_AdqBaseT, m_AdqIntT, -1, 0);

 

 

where m_AdqFM = 1250000 and m_AdqNM = 500000.

 

Trying to do the same with NiDAQmX i use:

 

DAQmxCreateTask("adquisicion",&taskadq);
DAQmxCreateAIVoltageChan(taskadq,"Dev1/ai0:1","AnalogInput",DAQmx_Val_RSE,-10,10,DAQmx_Val_Volts,NULL);
DDAQmxCfgSampClkTiming(taskadq,"OnboardClock",m_AdqFM, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, m_AdqNM);
 

 

Well, when executing the code i have the following error that I hadn't with NiDAQ (legacy) code.

 

ADC conversion attempted before the prior conversion was complete. Increase the period between ADC conversions.
 

 

I've read that this is related to the acquisition sample rate, but I don't know why with NiDAQ (legacy) works and with NiDAQmX doesn't work.

What am I doing wrong?

 

Thanks. Marc

 

 

 

0 Kudos
Message 1 of 1
(4,845 Views)