I have an application (written in C on Linux using NI-DAQmx8.0) in which I measure analog and digital signals simultaneously.
I quite often get the error
DAQmxStartTask :
ERROR-50004 : A pointer-type parameter is invalid. This may mean that
the pointer is NULL when it should not be or not NULL when it should be
or is not NULL but does not appear to point to the appropriate type of
object or data. The operation could not be completed as specified.
I am sure this is a bug in my own code, but I fail to find where this
bug is. I would be very happy if somebody could tell me more about what
this error really means. I don't really call DAQmxStartTask with any
pointer as argument. Below is a small piece of my code :
...
sprintf(achans,"Dev%d/ai0:31",seg);
sprintf(dchan,"Dev%d/port0/line0:15",seg);
sprintf(sclock,"/Dev%d/ai/SampleClock",seg);
//Analog channels
DAQmxErrChk(DAQmxCreateTask("",&AnaTaskHandle),"DAQmxCreateTask");
DAQmxErrChk(DAQmxCreateAIVoltageChan(AnaTaskHandle,achans,"",DAQmx_Val_RSE,-10.0,10.0,DAQmx_Val_Volts,NULL),"DAQmxCreateAIVoltageChan");
//Digital channels
DAQmxErrChk(DAQmxCreateTask("",&DigiInTaskHandle),"DAQmxCreateTask");
DAQmxErrChk(DAQmxCreateDIChan(DigiInTaskHandle,dchans,"",DAQmx_Val_ChanForAllLines),"DAQmxCreateDIChan");
//Timing
DAQmxErrChk(DAQmxCfgSampClkTiming(AnaTaskHandle,NULL,freq,DAQmx_Val_Rising,DAQmx_Val_ContSamps,nsamples),"DAQmxCfgSampClkTiming");
DAQmxErrChk(DAQmxCfgSampClkTiming(DigiInTaskHandle,sclock,freq,DAQmx_Val_Rising,DAQmx_Val_ContSamps,nsamples),"DAQmxCfgSampClkTiming");
//Start acquiring data
DAQmxErrChk(DAQmxStartTask(DigiInTaskHandle),"digiDAQmxStartTask");
DAQmxErrChk(DAQmxStartTask(AnaTaskHandle),"anaDAQmxStartTask");
...
and the error occurs on the last line of this (not always, but often enough). Has anyone seen this behavoiur?
Best regards,
Fredrik