Question

On looking at the examples provided in the documentation of the Power supply. The Programming has been done by adding two libraries AgilentRMLib and VisComLib in the C#. When i try to add the AgilentRMLib by Selecting the Add Reference->Agilent VISA COM Resourse Manager 1.0, an error is shown at the reference.

I tried adding the agtRM.dll directly from the Program Files. Still the error persists. Has anyone faced this problem before? Any Solutions for this? Do you have any other method to program the Power Supply from PC using Agilent IO.

Was it helpful?

Solution

I was able to use the VisaComLib(GlobMgr.dll) instead to program the GPIB using C# programming language. The pdf file link! was used as reference.

OTHER TIPS

If you don't mind using VBA, this code can help you accomplish what you are trying to do, make sure it has VISA COM 488.2 Formatted I/O in the References:

Public Sub TestVISA()
    Dim Dev_IO As VisaComLib.FormattedIO488
    Dim io_manager As VisaComLib.ResourceManager

'Start of Open GPIB port (or any VISA resource)
    Set io_manager = New VisaComLib.ResourceManager
    Set Dev_IO = New VisaComLib.FormattedIO488
    Set Dev_IO.IO = io_manager.Open("GPIB0::x::INSTR")    ' x is the GPIB address number of the Dev_IOument
    Set io_manager = Nothing
    Dev_IO.IO.Timeout = 10000  'set time out to 10 seconds, use this line to change timeout to any time out value per VISA spec
'End of Open GPIB port

'Send some SCPI command to the Dev_IOumnet
    Dev_IO.WriteString ("*IDN?")
    MsgBox ("Connected to: " & Dev_IO.ReadString)

'Close the port upon completion
    Dev_IO.IO.Close
    Set Dev_IO = Nothing 'release the object

End Sub

As you are using GPIB protocol, better use GPIB libraries and wrapper then code with native SCPI commands. That way your software will be more dependent to your applications and you can control almost everything. With VISA interface you have to worry about another layer but with this approach you can directly control your devices efficiently. I worked with VISA for couple of years but after that hardworking times now I can build my measurement systems with direct GPIB programming. You can find required libraries from NI's or Agilent's website.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top