Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multifunction synchronization on PCI 6071E

 

Hi, I got an error on synchronization of two functions with PCI 6071E.  The goal is to update one channel of analog and one channel of digital at the same time and for the same sample size. Please see attached program (DAQmx Configure Code) and its error message. i.e. I tried to utilize either sample clock (AO) or start trigger (AO) for the digital channel but never successful.  Thanks! 

/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&AOtaskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(AOtaskHandle,"Dev2/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(AOtaskHandle,"",SampleRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,SampleNumber));
DAQmxErrChk (GetTerminalNameWithDevPrefix(AOtaskHandle,"ao/SampleClock",trigName)); printf("%s\n", trigName);
DAQmxErrChk (DAQmxCreateTask("",&DOtaskHandle));
DAQmxErrChk (DAQmxCreateDOChan(DOtaskHandle,"Dev2/port0/line0","",DAQmx_Val_ChanPerLine));
DAQmxErrChk (DAQmxCfgSampClkTiming(DOtaskHandle,trigName,SampleRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,SampleNumber));
/*********************************************/
// DAQmx Write Code
/*********************************************/
DAQmxErrChk (DAQmxWriteDigitalLines(DOtaskHandle,SampleNumber,0,10.0,DAQmx_Val_GroupByChannel,DOdata,&DOwritten,NULL)); 
DAQmxErrChk (DAQmxWriteAnalogF64(AOtaskHandle,SampleNumber,0,10.0,DAQmx_Val_GroupByChannel,data,&AOwritten,NULL)); 
printf("%d samples written, press any key to start output\n",AOwritten); getchar();
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(DOtaskHandle));
DAQmxErrChk (DAQmxStartTask(AOtaskHandle));
/*********************************************/
// DAQmx Wait Code
/*********************************************/
DAQmxErrChk (DAQmxWaitUntilTaskDone(AOtaskHandle,DAQmx_Val_WaitInfinitely));

 

Download All
0 Kudos
Message 1 of 3
(2,881 Views)

What's confusing? As you should know from the specs for your board, it is strictly software timed and using the propert in the error message is not possible.

0 Kudos
Message 2 of 3
(2,867 Views)

Yeah, I realized that after the post. Thanks for your information. Originally it was suggested this could be done (http://forums.ni.com/t5/Multifunction-DAQ/6071E-analog-out-and-end-trigger/m-p/1457556). But maybe it worked on other devices, not for 6071E. Anyway, I am happy to find for asynchronized DO-AO the delay in our tests is only 1ms, which is good enough.    

0 Kudos
Message 3 of 3
(2,850 Views)