04-09-2009 02:30 AM
I have been trying to synchronize an analog input read with an analog signal generated by the Multifunction DAQ (NI 6289). Basically, the voltage AO signal is fed into a laser and the resulting intensity profile is read into a photodiode, which generates an AI signal read back into the DAQ. The two channels have the sampling rate and buffer size / number of samples.
However, triggering has presented with some problems; the manuals were not very clear on the subject of connecting channels, and no sample programs exist so far that demonstrate this on VB6.
What I have tried is physically connecting /Dev2/ao0 with /Dev2/APFI0, ( Dev2/ai0 is connected separately). Below is a little snippet of code:
'initialization goes here
...
DAQmxErrChk DAQmxCfgAnlgEdgeStartTrig(inputHandle, "Dev2/APFI0", DAQmx_Val_Slope1_RisingSlope, txtOffset.Text)
DAQmxErrChk (DAQmxReadAnalogF64(inputHandle, numSampsPerChannel, 10#, DAQmx_Val_GroupByScanNumber, dataBuffer(0), numSampsPerChannel, sampsPerChanREAD, ByVal 0))
DAQmxErrChk DAQmxWriteAnalogF64(outputHandle, numSampsPerChannel, False, 10#, DAQmx_Val_GroupByScanNumber, optData(0), sampsPerChanWritten, ByVal 0&)
DAQmxErrChk DAQmxStartTask(outputHandle)
I received the following error, -200265, "attempting to use an invalid analog input trigger", at the line ReadAnalogF64.
Attached is the code I used for the triggering event. Any help would be greatly appreciated.
04-10-2009 10:31 AM - edited 04-10-2009 10:32 AM