Discussion:
IVI vb express GPIB control prog example
(too old to reply)
Daniel Lawson
2009-07-28 11:38:53 UTC
Permalink
Hi Guys does anyone have a very simple program to gain control of
hardware via IVI drivers, I am trying the lecroy scope with no luck as
the examples online are all C based, is they start "using" i just get
errors in vb express edition

I have added the references so i must allmost be there!!

Thank you

Dan <- confused
Sofa_Snake
2009-08-03 15:28:29 UTC
Permalink
Here you go if anyone wonders!
Ive solved it!

Private Sub btnInitIO_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnInitDSOIO.Click
' set the I/O address to the text box in case the user changed
it.
' bring up the input dialog and save any changes to the text
box
Dim mgr As Ivi.Visa.Interop.ResourceManager

Dim ioAddress As String
On Error GoTo ioError

ioAddress = ScopeBox.SelectedItem

'txtAddress.Text = ioAddress
mgr = New Ivi.Visa.Interop.ResourceManager
iodso = New Ivi.Visa.Interop.FormattedIO488
iodso.IO() = mgr.Open("GPIB0::6::INSTR") 'GPIB0::6::INSTR
ioaddress

'do an instrument id check
Dim result As String
On Error GoTo ioErroridn

'iodso.IO.Clear()
'result = ""
iodso.WriteString("*idn?")
result = iodso.ReadString

scopeidstring.Text = result

Exit Sub
ioErroridn:
MsgBox("GetID Error:" & vbCrLf & Err.Description)

Exit Sub
ioError:
MsgBox("InitIO Error:" & vbCrLf & Err.Description)
End Sub

Loading...