
74
TOS5300_INTERFACE
Using Visual Basic 2008
Sample program
Imports Ivi.Visa.Interop
Public Class Form1
Dim rm As ResourceManager
Dim msg As IMessage
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
rm = CreateObject("VISA.GlobalRM")
'msg = rm.Open("MYDEV1", AccessMode.NO_LOCK, 0, "")
'
Version using a VISA alias
'msg = rm.Open("USB0::0x0B3E::0x1017::FF012345::INSTR", AccessMode.NO_LOCK, 0, "") '
Version using USB
End Sub
'
Queries the ID
Private Sub cmdIdn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdIdn.Click
msg.WriteString("*IDN?")
TextBox1.Text = msg.ReadString(256)
End Sub
'Sets the test voltage, limit voltage, and upper limit for judgments
Private Sub cmdCurr_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCurr.Click
msg.WriteString("SOUR:VOLT 1.5KV")
'Sets the test voltage to 1.5 kV
msg.WriteString("SOUR:VOLT:PROT 2KV")
'Sets the limit voltage to 2 kV
msg.WriteString("SENS:JUDG 10MA")
'Sets the upper limit for judgments to 10 mA
End Sub
'Queries the measured values
Private Sub cmdMeas_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdMeas.Click
msg.WriteString("MEAS:VOLT?")
'Queries the measured voltage
TextBox1.Text = msg.ReadString(256)
'Reads 256 bytes of data from the reception buffer, converts the
'string into a number, and assigns the converted value to a
'variable
msg.WriteString("MEAS:CURR?")
'Queries the measured current
TextBox1.Text = msg.ReadString(256)
'Reads 256 bytes of data from the reception buffer, converts the
'string into a number, and assigns the converted value to a
'variable
msg.WriteString("MEAS:RES?")
'Queries the measured resistance
TextBox1.Text = msg.ReadString(256)
'Reads 256 bytes of data from the reception buffer, converts the
string into a number, and assigns the converted value to a variable
End Sub
Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
msg.Close()
End Sub
End Class
Содержание TOS5300
Страница 8: ...8 TOS5300_INTERFACE This page is intentionally blank ...
Страница 14: ...14 TOS5300_INTERFACE This page is intentionally blank ...
Страница 15: ...Command Reference This chapter explains topics such as command details and registers Remote Control ...
Страница 76: ...76 TOS5300_INTERFACE ...