Keysight E5260/E5270 Programming Guide, Edition 4 3- 45
Programming Examples
Binary Search Measurements
Measurement
Result Example
Vth (V), Id (mA), Status
1.393, 1.0004, NEI
Data save completed.
Do you want to perform measurement again?
session.WriteString("ERR? 1" & vbLf) : err = session.ReadString(4 + 2) ’36
If err <> 0 Then session.WriteString("DZ" & vbLf) : GoTo Check_err
session.WriteString("DV " & t(3) & ",0,0,0.1" & vbLf) ’out= 0 V, comp= 0.1 A
session.WriteString("DV " & t(2) & ",0,0,0.1" & vbLf) ’out= 0 V, comp= 0.1 A
session.WriteString("XE" & vbLf) ’40
Dim mret As String = session.ReadString(16 + 17) ’data+comma+data+terminator
Dim dsearch As Double = Val(Mid(mret, 4, 12))
Dim status As String = Mid(mret, 17, 3)
Dim dsense As Double = Val(Mid(mret, 20, 12))
data(j, i) = Chr(13) & Chr(10) & dsearch & ", " & dsense * 1000 & ", " & status
session.WriteString("DZ" & vbLf) ’48
save_data(fname, title, value, data, nop1, nop2, session, t)
Exit Sub
Check_err: ’52
session.WriteString("EMG? " & err & vbLf) : msg = session.ReadString(256)
MsgBox("Instrument error: " & err & Chr(10) & msg, vbOKOnly, "")
End Sub
Line Description
36 to 37 Checks if an error occurred. If an error is detected, forces 0 V and goes to Check_err.
38 to 40 Applies voltage to device, and performs the binary search measurement.
42 to 46 Reads the returned data and stores it into the mret string variable. Finally, stores the
measured data into the data array.
48 to 50 Applies 0 V from all channels. And transfers the data stored in the data variable to the
save_data subprogram (see
Table 3-1). And the subprogram will save the data into a
CSV file specified by the fname variable and displays the data on a message box.
52 to 54 Displays a message box to show an error message if the error is detected.