297
Chapter 8 Application Programs
VB.net Example Program
4
8
'This example closes/opens multiple switches within a 4x4 Matrix.
'The switches can be controlled within one command line or listed
'separtely.
Private Sub Closebtn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Closebtn.Click
myDirectIO.WriteLine("CLOS (@120,123)")
End Sub
Private Sub Openbtn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Openbtn.Click
myDirectIO.WriteLine("OPEn (@120)")
myDirectIO.WriteLine("OPEn (@123)")
End Sub
'Digital Input/Output - on power up or after Reset all Digital I/O
'ports in the 3499 will be input ports. Mode 1 is default mode.
Private Sub DigIObtn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles DigIObtn.Click
myDirectIO.WriteLine("SENSE:DIGITAL:DATA:BYTE:VALue? 140")
'Read the Digital Input results 8 bits (1 byte), binary value is
'displayed.
Dim Digitalin As String
Digitalin = myDirectIO.Read()
TextBox2.Text = Digitalin
End Sub
'Create and execute a scan list
Private Sub Scanbtn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Scanbtn.Click
myDirectIO.WriteLine("SCAN (@200:209,220:225)")
myDirectIO.WriteLine("INIT")
myDirectIO.WriteLine("SCAN:LIST?")
Dim Scanresults As String
Scanresults = myDirectIO.Read()
Scanlst.Text = Scanresults
End Sub
End Class