I am trying to convert the SimpleReadWrite(located C:\Users\Public\Documents\National Instruments\NI-VISA\Examples\.NET\SimpleReadWrite) C code example for talking to a USB device and I am having some issues, the example work fine it just may be my conversion may be wrong any help would be apreciated.
This is the code I have,
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Try Dim rscName As String = "USB0::0x0B21::0x0025::4332514C323730353856::INSTR" 'Actaul name of resource Dim rm As ResourceManager = New ResourceManager() mbSession = DirectCast(rm.Open(rscName), MessageBasedSession) Dim textToWrite As String = "*IDN?\n" 'Standard ID query mbSession.RawIO.Write(textToWrite) Me.ListBox1.Items.Add(mbSession.RawIO.ReadString()) Catch ex As Exception GenPrcs.ErrorHndl(ex) End Try End Sub
everything works fine until the mbsession.rawio.readstring and then i get this error
again any help would be much aprriciated. Thanks and have a great day