Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50004 in DAQmxStartTask

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
0 Kudos
Message 1 of 4
(4,206 Views)
As I wrote this message, I was experiencing this problem more often than not. I thought "Ok, can't hurt to reboot the computer", I did that and voila! The problem does not occur. I am concerned it will come back though after some time. But this indicates that the NIDAQmx8.0 driver is causing the problem, doesn't it? Is there any way to restart this driver without rebooting the computer?

Best regards,
Fredrik
0 Kudos
Message 2 of 4
(4,204 Views)
I'm seeing this Error -50004 as well, I have no idea what it could be. I'll let you guys know if i find out.
0 Kudos
Message 3 of 4
(3,757 Views)
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 fixed this by slowing down the reads to NI-9425, i then called an NI application's engineer and they say

that at the moment that is the only fix. according to them i was trying to read from the NI-9425 buffer when 

there was nothing there.  So this is an ok fix but still seems like a band aid fix.  

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