Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the supplied libraries with HP 6632A & USB GPIB controller

I have a HP Agilent 6632A DC Power supply and I have recently got a NI GPIB-USB-HS to connect it to a computer. Now I have used the device explorer in the software to access the power supply and I can use the commands from the manual to configure power settings and measure readings by just typing them into the query box.


I am now trying to integrate the supply into a C++ program that I have using the code from the Show Sample button on the communicator box. All I need to be able to do is send using ibwrt the command I want but I can't get the code example to compile when included in my program. I have included the required headers such as ni488.h but it keeps giving me invalid conversion compile errors.


Please could some one tell me where I am going wrong or give me a very basic C++ source code example which just sends the command "IOUT?" to the device using ibwrt.

Thanks


0 Kudos
Message 1 of 7
(5,141 Views)
Here is the error that I am getting:

43. invalid conversion from `const void*' to `void*'
43. initializing argument 2 of `int ibwrt(int, void*, long int)'

The code that I am using is attached below.

0 Kudos
Message 2 of 7
(5,121 Views)
And this is the header file.

Thanks again
0 Kudos
Message 3 of 7
(5,119 Views)

Jeffnet,

I'm a bit confused. You mentioned that it won't compile on an ibwrt call, but in your attached main.cpp, there is no ibwrt call. Could you please repost the program file along with the line number and error of what doesn't compile?

Thanks.

0 Kudos
Message 4 of 7
(5,107 Views)
Thanks for your help but I have managed to get it working. It needed the GPIB-32.obj linked in the compiler under dependancies to compile.

0 Kudos
Message 5 of 7
(5,097 Views)
Regarding the main file I managed to upload the wrong one so plese ignore it.
0 Kudos
Message 6 of 7
(5,094 Views)
Glad you are back on track after linking in the GPIB-32.OBJ file. I have to admit I am surprised that you didn't see more errors for every GPIB call when the .OBJ file was not being linked in.
 
Anyway, mystery is solved. Thanks for the update!
0 Kudos
Message 7 of 7
(5,081 Views)