Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I control Agilent with GPIB-USB-HS and vb6?

Hello.

 

Thank you for you help in advance.

 

I want to control an Agilent / hp 3061A power supply with my own software. I am using VB6 and the GPI-USB-HS.

 

How do I start with this?

 

I read documentation on the GPIB but there is nothing like set to 12v and 3 amp.

 

As you can see, I can't figure out what do I need to start. I hope you can point me to the right documentation. I think I need to send commands to GPIB that will send commands to the Power Supply, but haven't found enough information...

 

I hope you can help me.

 

Thank you,

0 Kudos
Message 1 of 7
(4,581 Views)

All of the commands will be listed in the manual for the instrument since each and every instrument is different. You need to get that from Agilent, of course.

0 Kudos
Message 2 of 7
(4,578 Views)

Ok..I got the commands file for the Power Supply.

 

Now my question is if I can send these commands directly from my VB6 application to the Power Supply or do I need to send them first to the GPIB-USB-HS ?

 

I mean do I need to encapsulate the Power Supply command within a GPIB-USB-HS command ?

 

Thank you again.

0 Kudos
Message 3 of 7
(4,571 Views)

You would use the viWrite function with some command as the parameter. This will instruct the GPIB card to send the command to the instrument. Conversely, to read from the instrument, you would use the viRead function. The functions and syntax are contained in the NI-VISA help file.

0 Kudos
Message 4 of 7
(4,566 Views)

You didn't mention which version of NI-488.2 you have installed, but with some of the later versions, the examples are easily available from the Start->Programs->National Instruments->NI-488.2->Examples->Visual Basic. In that folder, there are a few examples that are written for Visual Basic 6.0. One in particular that you might be interested in checking out is the one in the PowerSupplyStepUp folder. While it was written to acquire measurements from a Tektronix Programmable Power Supply, it illustrates how to use a GPIB Interface to talk to a GPIB Instrument that is a Power Supply.

 

Hope this information helps.

 

gpibtester

0 Kudos
Message 5 of 7
(4,551 Views)

Finally, I got communication with the power supply. With VB6 I can send a viClear() and I can see in the power supply that it clears any error and set the PMT led and the LSN led.

 

Now, my question is how do I set a voltage?

 

With Agilent VISA it is: OUTPUT @PS;"VSET 5;ISET l0"

 

how do I make it with NI ?

 

I think I should still use the viWrite but how do I put the string: OUTPUT @PS;"VSET 5;ISET l0" ?

 

Thank you again for your help.

0 Kudos
Message 6 of 7
(4,543 Views)

If you have started from the VB6 example in the National Instruments folder then you can do something like this

 

ilwrt Dev%, "VSET 5;ISET l0", 14

 

 

where Dev% is the device number/handle you acquired from the ildev function

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 7 of 7
(4,520 Views)