LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous data acquisition with external digital trigger

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);
  ..............
}

0 Kudos
Message 1 of 4
(2,729 Views)
Hi Knowhow,

This is the LabVIEW board, I think you'll get better help on your issue if you repost your question to the LabWindows CVI board 😉





We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 4
(2,724 Views)

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!






Elijah Kerry
NI Director, Software Community
0 Kudos
Message 3 of 4
(2,700 Views)
Knowhow,

Sorry, I'm afraid I misunderstood your post.  I thought you were doing a digital input task.  This will work just fine with your card.  Your post was responded to be another AE on the CVI forum, which you can find here.
Elijah Kerry
NI Director, Software Community
0 Kudos
Message 4 of 4
(2,690 Views)