LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NULL pointer argument to library function

Solved!
Go to solution

I am testing my PCIe-6321 board with LabWindows CVI 2012 and DAQmx. A very simple test code as in the attachment was written and compiled okay. But when I ran, I got the following error message:

FATAL RUN-TIME ERROR: "DAQmxCodesTest.c", line 34, col 9, thread id 0x000025A8: Null pointer argument to library function.

Line 34 is as follows: 

DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,nSamples,10.0,DAQmx_Val_GroupByChannel,gData,nSamples*NumChannels,&numRead,NULL));

When I ran the DAQmx AnalogInput  example codes, there was no errors generated and ran properly with proper voltage output. [By the way for many DAQmx calls with NI boards, the default is in DIFFERENTIAL mode when using the DAQmxCreateAIVoltageChan(). It took me a while to figure out after digging through the CVI HELP calls. I hope this info may help someone later.]  But for this particular call, can someone help me what was wrong with it? 

 

0 Kudos
Message 1 of 3
(7,327 Views)

You must allocate memory on gdata array before passing it to DAQmxReadAnalogF64



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(7,323 Views)
Solution
Accepted by topic author bopja

Thanks, 

 

0 Kudos
Message 3 of 3
(7,306 Views)