12-18-2013 05:19 PM
We used to be able to run the 6024E with concurrent DAQ output and analog input in triggered mode. But when we upgraded to the DAQmx software, we could no longer do this. If both input and output are set to use the same trigger, the input fails. Input acquisition works, however, if there is no concurrent output. How can we run the 6024E with DAQmx with both input and output set to the same trigger?
12-19-2013 03:47 PM
Are you routing the trigger internally or is this an external trigger?
12-19-2013 05:05 PM
I believe it is triggered internally.
// --------The task for analog input is created and configured:
DAQmxCreateAIVoltageChan(taskHandle,chanName,"",
terminalConfig[count], inputRangeMin, inputRangeMax, DAQmx_Val_Volts,NULL));
DAQmxCfgSampClkTiming(taskHandle,"", samplerate,
DAQmx_Val_Rising, DAQmx_Val_ContSamps, buffersize)
DAQmxRegisterEveryNSamplesEvent (taskHandle,
DAQmx_Val_Acquired_Into_Buffer, nSamples, 0,
(DAQmxEveryNSamplesEventCallbackPtr) &Callback, NULL));
// ------The task for the output signal is configured:
sprintf(szDevicePort,"Dev%d/ao%d\n",iDevice,channel);
DAQmxCreateAOVoltageChan(taskHandleOutput,szDevicePort,"",outputRangeMin,outputRangeMax,DAQmx_Val_Volts,NULL));
DAQmxCfgSampClkTiming(taskHandleOutput,"",daccfg->outputrate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,daccfg->numsamples+1));
// ---- Then both the input and output channels are set to the same trigger:
sprintf(szDevicePort,"/Dev%d/PFI1",iDevice); // device 0
DAQmxCfgDigEdgeStartTrig(taskHandle,szDevicePort,DAQmx_Val_Rising); // ****** LINE XXX ****
DAQmxCfgDigEdgeStartTrig(taskHandleOutput,szDevicePort,DAQmx_Val_Rising)
// the trigger is sent:
SetDigitalPort(NIDAQ_DIO_TRIGCH, NIDAQ_DIO_STATEHIGH);
Sleep(1);
SetDigitalPort(NIDAQ_DIO_TRIGCH, NIDAQ_DIO_STATELOW);
where SetDigitalPort is sending a pulse to pin 7 in the DIO block on the BNC-2090, which is connected to PFI1 and USER2
If LINE XXX is included, it runs but fails later when it times out while reading data blocks:
if (bufferdone->WaitFor(time2wait) != wrSignaled)
return 0;
12-20-2013 11:01 AM
You have to start the tasks (DAQmxStartTask) before sending the trigger.
Best Regards,