Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

6032A operation under LWCVI

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 2
(3,611 Views)
Solution
Accepted by Greg Knight

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.

 

 

Message 2 of 2
(3,603 Views)