10-13-2011 09:05 AM
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,
10-13-2011 09:46 AM
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.
10-13-2011 11:07 AM
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.
10-13-2011 11:38 AM
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.
10-14-2011 10:34 AM
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
10-14-2011 06:18 PM
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.
10-17-2011 12:33 PM
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