Keysight E5260/E5270 Programming Guide, Edition 4
3- 7
Programming Examples
Programming Basics for Visual Basic .NET Users
Sub perform_meas(ByVal session As IMessage, ByVal t() As Integer) ’25
Dim i As Integer = 0 : Dim j As Integer = 0
Dim nop1 As Integer = 1 : Dim nop2 As Integer = 1
Dim data(nop2 - 1, nop1 - 1) As String
Dim value As String = "Enter data header"
Dim fname As String = "C:\enter_file_name.txt"
Dim title As String = "Measurement Result"
Dim msg As String = "No error." : Dim err As Integer = 0
’ insert measurement program code 34
session.WriteString("ERR? 1" & vbLf) : err = session.ReadString(4 + 2)
If err <> 0 Then session.WriteString("DZ" & vbLf) : GoTo Check_err
session.WriteString("DZ" & vbLf)
save_data(fname, title, value, data, nop1, nop2, session, t) ’40
Exit Sub
Check_err:
session.WriteString("EMG? " & err & vbLf) : msg = session.ReadString(256)
MsgBox("Instrument error: " & err & Chr(10) & msg, vbOKOnly, "")
End Sub ’46
Line
Description
25
Beginning of the perform_meas subprogram.
26 to 32
Declares variables used in this program template. The values are dummy. You must
change the values to match your program. If you find unnecessary variables, delete
them.
i
and
j
: Variables used to specify the element of the
data
array.
nop1
and
nop2
: Number of measurement steps. Also used to declare the
data
array.
data
: String data array used to store the measurement result data.
val
: String data variable to store the header (first line) of the displayed data.
fname
: Full path name of the measurement result data file.
title
: Title of the message box used to display the measurement result data.
msg
and
err
: Variables used to store an error message and an error code.
34
The line is placed as dummy. Remove the line and insert your program code to control
the instruments and perform measurement.
36 to 37
Checks if the instrument causes an error, and goes to Check_err if an error is detected.
39 to 40
Applies 0 V from all channels and calls the save_data subprogram (lines 48 to 70).
43 to 45
Opens a message box to display error message if an error is detected.
46
End of the perform_meas subprogram.
Summary of Contents for E5260 Series
Page 1: ...Keysight Technologies E5260 E5270 Series of Parametric Measurement Solutions Programming Guide...
Page 3: ...User s Guide B2900 9001x xxxx 201x Edition x...
Page 13: ...1 Programming Basics...
Page 63: ...2 Remote Mode Functions...
Page 108: ...2 46 Keysight E5260 E5270 Programming Guide Edition 4 Remote Mode Functions Initial Settings...
Page 109: ...3 Programming Examples...
Page 185: ...4 Command Reference...
Page 335: ...5 Error Messages...
Page 349: ......