10-27-2009 05:09 PM
I have a 6032A power supply (GPIB Address 3) and an NI-GPIB (GPIB Address 0) and both show up under NI measurement and explorer under Devices and interfaces. I downloaded the driver for the 6032A and ran the following simple function to see if it would reset:
hpxxxa_init ("GPIB::3", VI_ON, VI_ON, 2, ViSession_ID);
The program compiles. Vi Session_ID is defined in main as a ViPSession, the 6032A powers up as address 3, and the parameter 2 in the above function indicates 6032A.
I get a fatal run time error --> Null pointer to a Library function. The file that it points to is HP6XXXA.c. The function is
if ((hp6xxxa_status = viOpen (rmSession, resourceName, VI_NULL< VI_NULL< instrSession)) <0)
It points to the parameter instrSession as being the problem.
Your help is most appreciated to get me going. Please respond by email to greg_k_knight@raytheon.com
Solved! Go to Solution.
10-28-2009 12:54 AM
The last parameter is intended to be an output parameter and expects a pointer pointing to allocated memory.
Try
[...]
ViSession ViSession_ID
[...]
hpxxxa_init ("GPIB::3", VI_ON, VI_ON, 2, &ViSession_ID);
[...]
instead.