Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Where did GetLocalManager Go?

I am a newbie learning VB .NET with the latest version of Visual Studio 2019 Community and the current version of NI-VISA 19.   I am trying to communicate with a Siglent spectrum analyzer.  The NI-VISA .NET examples are for C not VB but with an older version of NI-VISA (NationalInstruments.VisaNS) this snip of code worked but no longer.  I now get an error that GetLocalManager is no longer a member of ResourceManager.  Any help would be very much appreciated.  Thanks in advance and stay safe

 

Imports NationalInstruments.Visa
Imports Ivi.Visa


Public Class Form1
    Dim mbSession As MessageBasedSession
    Dim visa_string As String

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        visa_string = TextBox1.Text
        mbSession = CType(ResourceManager.GetLocalManager().Open(visa_string), MessageBasedSession)

        Dim responseString As String = mbSession.Query("*IDN?")
        MsgBox(responseString)

        mbSession.Dispose()
    End Sub
End Class

 

0 Kudos
Message 1 of 1
(2,309 Views)