Hi All.
I'm using waveform where I continously generate new data to the buffer and my problem is that the first buffer upload takes about 35ms longer than all
other uploads. Also the first upload is much longer than different waveform with the same buffer length on the same computer and the same DAQ boards. I
tried it with PCI-6723 and PCIe-6353. I would like to know what cause this delay for preventing it in the future. I'm using everyN callback for upload
new data to the buffer and I'm always one chunk ahead.
DAQmxCreateTask("",&m_hSequenceTaskOutAnalog);
for (lx_int32 i = 0; i< (lx_int32)m_vectResourcesAnalog.size(); i++)
{
DAQmxCreateAOVoltageChan(m_hSequenceTaskOutAnalog,m_vectResourcesAnalog[i],"",dMinV,dMaxV,DAQmx_Val_Volts,NULL);
}
DAQmxCfgSampClkTiming(m_hSequenceTaskOutAnalog,("/" + sDevice + "/ctr0InternalOutput"),m_iSamplesPerSecondForOneChannel,DAQmx_Val_Rising,DAQmx_Val_ContSamps,2 * m_iDataLengthPerChannelInOneWindow * m_iNumChannelsAnalog);
DAQmxSetWriteRegenMode(m_hSequenceTaskOutAnalog, DAQmx_Val_DoNotAllowRegen);
DAQmxRegisterEveryNSamplesEvent(m_hSequenceTaskOutAnalog, DAQmx_Val_Transferred_From_Buffer, m_iDataLengthPerChannelInOneWindow, 0, EveryNCallback, this);
DAQmxWriteAnalogF64(m_hSequenceTaskOutAnalog,2 * m_iDataLengthPerChannelInOneWindow,0,10.0,DAQmx_Val_GroupByScanNumber,m_pdAnalogDataWaveform,NULL,NULL);
I measured that DAQmxWriteAnalogF64 on PCI-6723 takes depends on buffer size:
1500 samples 33 to 38 ms
3000 samples 34 to 42 ms
30000 samples 34 to 39 ms
300000 samples 35 to 40 ms
on the first upload and
1500 samples 0.045 to 0.056 ms
15000 samples 0.076 to 0.194 ms
1360000 samples 3.0 to 3.6 ms
on the every other upload.
I measured similar times also for PCIe-6353
Any idea and suggestions how to speed up the first writing?