I thought that if i include some code and the error message, that might help.
Brady
code:
/*********************************************/
/*/ DAQmx Configure Code
/*********************************************/
DAQmxCreateTask ("analogInTask", &analogTask); /* Create a task for analog input */
DAQmxCreateTask ("couterOutTask", &counterTask); /* Create a task for analog input */
/* create an analog input channel named aiChannel */
DAQmxCreateAIVoltageChan (analogTask, ChanString.c_str(), "aiChannel", DAQmx_Val_RSE, -10.0, 10.0,
DAQmx_Val_Volts,"");
/* create the clock for my analog input task*/
DAQmxCfgSampClkTiming (analogTask, counterSource, rate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, numSamplesPerTrace);
/*Configure analog input buffer*/
DAQmxSetBufferAttribute (analogTask, DAQmx_Buf_Input_BufSize, 5*numSamplesPerTrace);
/*Configure Hardware Analog Trigger*/
DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig(analogTask,"aiChannel",TriggerSlope,TriggerVal));
DAQmxErrChk (DAQmxSetAnlgEdgeStartTrigHyst(analogTask, .05));
/* create a counter output channel named coChannel */
DAQmxCreateCOPulseChanFreq (counterTask, counterChannel, "coChannel", DAQmx_Val_Hz,
DAQmx_Val_Low, 0, rate, 0.5);
/* create the clock for my counter output task*/
DAQmxCfgImplicitTiming (counterTask, DAQmx_Val_FiniteSamps, numpoints);
/*Route analog trigger on PFI0 to RTSI1 for use below*/
// DAQmxErrChk (DAQmxConnectTerms ("/Dev1/PFI0", "/Dev1/RTSI5", DAQmx_Val_DoNotInvertPolarity ));
/*Configure counter output Trigger*/
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig (counterTask, "/Dev1/PFI0", DAQmx_Val_Rising ));
DAQmxSetTrigAttribute (counterTask, DAQmx_StartTrig_Retriggerable, TRUE);
/*********************************************/
/*/ DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(counterTask));
DAQmxErrChk (DAQmxStartTask(analogTask));
}
/*********************************************/
/*/ DAQmx Read Code
/*********************************************/
while( !Terminated )
{
DAQmxErrChk (DAQmxReadBinaryI16 (analogTask, Parent->NumPointsPerBuffer, timeout,
DAQmx_Val_GroupByChannel , readArray, arraySize,
&sampsPerChanRead, NULL));