I have a new question
I need to create an event buffered task when the source=80mhz internal card timebase, gate=source of other counter (e.q for counter 1 use 0, for 3 use 2)
I know that with Traditional-DAQ it will look like )see attch file):
Now the convertion to DAQmx :
++++++++++++++++++++++++++++++
void SetupEvent(void)
{
if ( Internal.P6602_ID == -1 ) return;
sprintf(Chan,"Dev%d/ctr1",Internal.P6602_ID); // channel 1
DAQmxErrChk (DAQmxCreateTask("EventChan1",&DaqmxTasks.PCI_6602[1]));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(DaqmxTasks.PCI_6602[1],Chan,"EventChan1",DAQmx_Val_Rising,0,
DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampTimingType, DAQmx_Val_SampClk) );
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampQuant_SampMode,DAQmx_Val_ContSamps) );
DAQmxErrChk(DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1],DAQmx_SampQuant_SampPerChan, BUF_MAX));
// set source
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampClk_Src, "/Dev1/80MHzTimebase"));
// and gate
sprintf(msg,"/Dev%d/ctr0Source",Internal.P6602_ID);
DAQmxErrChk(DAQmxSetChanAttribute (DaqmxTasks.PCI_6602[1], Chan, DAQmx_CI_CountEdges_Term, msg,0));
sprintf(Chan,"Dev%d/ctr3",Internal.P6602_ID); // channel 3
DAQmxErrChk (DAQmxCreateTask("EventChan3",&DaqmxTasks.PCI_6602[3]));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(DaqmxTasks.PCI_6602[3],Chan,"EventChan3",DAQmx_Val_Rising,0,
DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3], DAQmx_SampTimingType, DAQmx_Val_SampClk) );
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3], DAQmx_SampQuant_SampMode,DAQmx_Val_ContSamps) );
DAQmxErrChk(DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[3],DAQmx_SampQuant_SampPerChan, BUF_MAX));
DAQmxErrChk (DAQmxSetTimingAttribute (DaqmxTasks.PCI_6602[1], DAQmx_SampClk_Src, "/Dev1/80MHzTimebase"));
sprintf(msg,"/Dev%d/ctr2Source",Internal.P6602_ID);
DAQmxErrChk(DAQmxSetChanAttribute (DaqmxTasks.PCI_6602[3], Chan, DAQmx_CI_CountEdges_Term, msg,0));
return;
Error:
Internal.StartStop = OFF;
if ( DAQmxFailed(error) ) DAQmxGetExtendedErrorInfo(errBuff,1024);
StopCallBack();
MessagePopup ("SetupEvent Error", errBuff);
return;
}
I am not sure this is the way to do it .
Can samebody help ?
Thanks, Galia