Dim mret1 As String = unit1.ReadString(16 * 2 * nop1 + 1)
Dim mret2 As String = unit2.ReadString(16 * 2 * nop1 + 1)
Dim time As Double : Dim status As String : Dim meas As Double
For i = 0 To nop1 - 1
time = Val(Mid(mret1, 4 + i * 16 * 2, 12))
status = Mid(mret1, 17 + i * 16 * 2, 3)
meas = Val(Mid(mret1, 20 + i * 16 * 2, 12))
data(0, i) = Chr(13) & Chr(10) & meas * 1000 & ", " & time * 1000 & ", " & status
Next i
For i = 0 To nop1 - 1
time = Val(Mid(mret2, 4 + i * 16 * 2, 12))
status = Mid(mret2, 17 + i * 16 * 2, 3)
meas = Val(Mid(mret2, 20 + i * 16 * 2, 12))
data(1, i) = Chr(13) & Chr(10) & meas * 1000 & ", " & time * 1000 & ", " & status
Next i
unit1.WriteString("DZ" & vbLf) : unit2.WriteString("DZ" & vbLf)
save_data(fname, title, value, data, nop1, nop2, unit1, unit2, t)
Exit Sub
Check_err:
unit1.WriteString("DZ" & vbLf) : unit2.WriteString("DZ" & vbLf)
If ret = 1 Then unit1.WriteString("EMG? " & err & vbLf) : msg =
unit1.ReadString(256)
If ret = 2 Then unit2.WriteString("EMG? " & err & vbLf) : msg =
unit2.ReadString(256)
MsgBox("Unit" & ret & " error: " & err & Chr(10) & msg, vbOKOnly, "")
Exit Sub
End Sub
Line
48 to 62
Reads measurement data and stores it into the data array.
64 to 65
Applies 0 V from all channels and transfers the data stored in the data variable to the
save_data subprogram. And the subprogram will save the data into a CSV file specified
by the fname variable and displays the data on a message box.
68 to 73
Applies 0 V from all channels and displays a message box to show an error message.
Measurement
Result Example
Programming Examples
Using Trigger Function
I (mA), Time (msec), Status
Unit1
11.345, 18.8, NAI
22.685, 50, NAI
34.035, 81.2, NAI
45.385, 112.4, NAI
56.73, 143.5, NAI
Unit2
10.98, 13.6, NAI
21.98, 47.1, NAI
32.98, 78.2, NAI
43.965, 109.6, NAI
54.965, 140.7, NAI
3- 64
Keysight E5260/E5270 Programming Guide, Edition 4
Description
'48
'64
'68