Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

concurrent DAQ output and analog input in triggered mode with the 6024E

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?

0 Kudos
Message 1 of 4
(4,189 Views)

Are you routing the trigger internally or is this an external trigger?

Ryan P.
CLA
0 Kudos
Message 2 of 4
(4,160 Views)

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;

0 Kudos
Message 3 of 4
(4,154 Views)

You have to start the tasks (DAQmxStartTask) before sending the trigger.

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 4
(4,131 Views)