I am setting up a counter with the following code on a PCI-6251, OS X. I am trying to create a clock at 10000 Hz. The board often returns a non-fatal positive error 25600 with no associated description (on OS X).
What does it mean? I reset the board prior to calling this function.
#define WarnOnError(x) { int error = (x); if ( error != 0) { char errBuff[2048]; DAQmxBaseGetExtendedErrorInfo(errBuff,2048); fprintf(stderr, "Line %d in %s, Error #%d: %s\n", __LINE__, __FILE__, error, errBuff);} }
TaskHandle createMasterClockTask(float64 freq, uInt64 npoints, bool32 continuous)
{
// Task parameters
int32 error = 0;
TaskHandle taskHandle = 0;
// Channel parameters
char chan[] = "Dev1/ctr0";
float64 duty = 0.5;
float64 delay = 0.0;
error = DAQmxBaseCreateTask("",&taskHandle);
WarnOnError(error);
error = DAQmxBaseCreateCOPulseChanFreq(taskHandle,chan,"",DAQmx_Val_Hz,DAQmx_Val_Low,delay,freq,duty);
WarnOnError(error);
error = DAQmxBaseCfgImplicitTiming(taskHandle, DAQmx_Val_ContSamps , npoints );
WarnOnError(error);
return taskHandle;
}