01-04-2008 02:54 PM - edited 01-04-2008 02:57 PM
(DAQmxCreateTask("AI",&m_hNIAITask));DAQmxErrChk
DAQmxErrChk
(DAQmxCreateAIVoltageChan(m_hNIAITask,"Dev1/ai0: Dev1/ai1","AIInput",DAQmx_Val_Cfg_Default,f64Min,f64Max,DAQmx_Val_Volts,NULL));DAQmxErrChk
(DAQmxCfgSampClkTiming(m_hNIAITask,"",(float64)m_dwBaseSampleRate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,m_dwBaseSampleRate / 10));DAQmxErrChk
(DAQmxGetTaskAttribute(m_hNIAITask,DAQmx_Task_NumChans,&uiNumChannels));DAQmxErrChk
(DAQmxCfgDigEdgeStartTrig(m_hNIAITask, "/Dev1/PFI0", DAQmx_Val_Rising));DAQmxErrChk
(DAQmxStartTask(m_hNIAITask));DAQmxErrChk
(DAQmxSetReadAttribute(m_hNIAITask, DAQmx_Read_RelativeTo, DAQmx_Val_CurrReadPos));while (bContinue) {
(DAQmxGetReadAttribute(m_hNIAITask, DAQmx_Read_AvailSampPerChan, &iRead, 0)); if (iRead > 0) {DAQmxErrChk
(DAQmxReadAnalogF64(m_hNIAITask,-1,10.0,DAQmx_Val_GroupByScanNumber,(float64*)pf64WriteIdx/*pdWriteIdx*/,uiArraySampleSize,&iSamplesRead,NULL));DAQmxErrChk
//...Rest of code removed for brevity
} }01-07-2008 12:20 PM
04-09-2008 11:01 AM - edited 04-09-2008 11:02 AM
Neal,
Thanks for the response. Unfortunately we are still having a problem triggering the 6009 using the PFI0 input.
At first we tried hooking the 2.5V and 5.0V outputs on the 6009 to a momentary contact switch, then returning this to PFI0. We checked the output of the 2.5 and 5V outputs and they appear nominal. Even with the contact switch held down, the 6009 refuses to trigger the data collection.
Thanks for any input,
Don Hess
04-10-2008 11:34 AM
04-10-2008 11:51 AM - edited 04-10-2008 11:59 AM
My appologies for not stating this clearer.
I tested with both a 2.5V and 5V source. My signal is well within the TTL spec. I tested 0->5.0V by DIRECTLY shorting pin 31 (+5V) and pin 29 (PFI0) directly on the USB6009. It just refuses to trigger.
http://i52.photobucket.com/albums/g20/digital_griffin/USB6009WiringDiagram.png
Thank you,
Don Hess
04-11-2008
12:17 PM
- last edited on
03-12-2012
09:46 AM
by
MaryH
HI again Don,
Thank you for the clarification. I notice that you do not have a pulldown resistor to sink current on your digital line. This is necessary because the USB-6009 has an internal pull-up resistor on its digital lines.
In the USB-6008/6009 User Guide and Specifications, there is a figure that shows various ways to connect signals to the digital line (Figure 14). I believe method 4 will work for what you are trying to accomplish. Give this a try and see if that helps.
Message Edited by Neal M on 04-11-2008 12:17 PM
04-11-2008 02:43 PM
Thanks a lot Neal
The reference guide and a voltmeter led me to the problem. The PFI0 is a +5V source itself. Hooking it to GND with a resistor (to limit current) did the magic trick.