AnsweredAssumed Answered

34972A Controlling Via Visual Basic .Net 2010

Question asked by on Apr 5, 2012
Latest reply on Apr 30, 2012 by hognala
Hi All,

I am new to the 34972A instrument, and I am trying to create a Visual Basic .Net 2010 application to Gather data from 16 channels and to toggle some I/O.

Ran a tutorial using the Console demo.  It works, but it bugs me that I have to do this:

Imports Ivi.Visa.Interop
Imports Agilent.CommandExpert.ScpiNet.Ag3497x_1_13

Module Module1

    Sub Main()

        'Dim I34972A As New Ivi.Visa.Interop.ResourceManager
        'Dim I34972A As Ag3497x = New Ag3497x(LXI)
        'UsbTransport = I34972A.Transport.Visa.ResourceName.Get
        'Dim I34972A As Ag3497x = New Ag3497x(UsbTransport)

        Console.WriteLine("Connecting to 34972A LXI Data Acquisition/Switch Unit...")

        Dim I34972A As Ag3497x = New Ag3497x("USB0::0x0957::0x2007::my49007650::0::INSTR")
        Dim IDN As String = Nothing


        Console.WriteLine("*IDN query returns: " & IDN)
        Console.WriteLine(" Press any key to exit...")
    End Sub

It works fine, but I want to do this more intelligently by identifying all available transports ( I have 3 other USB instruments)

I want to programmatically discover what the transport name is.

I don't know how to instantiate Ag3497x class so I have access to all the methods and properties.  Above I am forced to enter a string "USB0::0x0957...."  I want to discover how many devices are connected and choose the appropriate transport.  I don't want to hard code it.

Does any one know how to :

1. instantiate the "new" class
2. programmatically discover all available transports
3. open the transport
4. Write data to it 
5. close the transport.

I would really appreciate any help you can provide!