11-08-2006 10:46 PM
Hello
I have E6025 Card. I want to acquire 1000 sample whenever external digital trigger happens. (About 100HZ) unfortunately, I can only get the first 1000 samples. How can I do it continuously?
Here is part of code I am using
I am looking for the solution in C.
Thanks
DAQmxCreateTask("acq",&m_DAQtaskHandle);
DAQmxCreateAIVoltageChan(m_DAQtaskHandle,"Dev1/ai0","",DAQmx_Val_RSE ,-10.0,10.0,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(m_DAQtaskHandle,"",200000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps ,1000);
DAQmxCfgDigEdgeStartTrig(m_DAQtaskHandle,"/Dev1/PFI0",DAQmx_Val_Rising);
DAQmxRegisterEveryNSamplesEvent (m_DAQtaskHandle,DAQmx_Val_Acquired_Into_Buffer,m_spectrumSize,0,EveryNCallback,this);
int32 EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
{
..............
DAQmxReadAnalogF64(taskHandle,pDAQ->m_spectrumSize,10.0,DAQmx_Val_GroupByScanNumber, data,pDAQ->m_spectrumSize,&read,NULL);
..............
}
11-09-2006 03:10 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
11-10-2006 08:05 AM
Knowhow,
If you were using an M series card you could accomplish this acquisition using
a correlated Digital Input. Unfortunately that is not a possibility with
an E-series card. You can trigger it once with an E series and let it read 1000
samples as you have done, but it won't be retriggerable with hardware.
If you can suffice without hardware timing, you could stop and restart the task
in software and let it trigger again as it did the first time. However,
there is no way to guarantee you're getting all the data and you won't be able
to acquire the data at high rates.
If you must you hardware timing, consider purchasing an M series board. I
hope this helps and good luck!
11-10-2006 12:24 PM