Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200230 for DAQmxReadCounterScalar32

Hi,
Could someone please explain what error -200230 (DAQmxErrorNULLPtrForC_Api) means. I am using the matlab DLL interface with the NI-DAQmx drivers on a PCI-6229 M-Series card.
 
I want to read counter values from a channel created with DAQmxCreateCICountEdgesChan however this error shows up and I cannot understand why.
 
I am calling the function using the method shown below, can anyone see any problems?
 
DataPtr = libpointer('uint32Ptr',[]);
reserved = libpointer('uint32Ptr',[]);
[status Data reserved] = calllib('DAQmxLib','DAQmxReadCounterScalarU32',TaskHandle,10,DataPtr,reserved);
 
There are no errors during task and channel creation, only when I try to read the value.
 
Thanks
Luke
0 Kudos
Message 1 of 2
(3,130 Views)
Hello LukeC,

The -200230 error probably means that a NULL pointer is being passed for a required parameter.  If you are getting the error when you are trying to read the value but not when you are trying to create the channel, I think the the NULL pointer is the parameter that is supposed to point to the read buffer.  However, I see that you have initialized DataPtr so I'm not sure why it thinks that it is NULL.

1) You could try writing to the DataPtr array before calling DAQmxReadCounterScalarU32 and see if Matlab gives you some sort of pointer error.
2) Does Matlab come with any examples that you can try running?  I would suggest giving those a try and seeing what your results are.
3) I would also try contact Matlab and asking them about this error.  Because they wrote their own API to our NI DAQmx driver, I'm not to familiar with how their API works.  They might have some more insight on why you are getting this error.
Eric
DE For Life!
0 Kudos
Message 2 of 2
(3,119 Views)