3-38 Agilent B1500 VXIplug&play Driver User’s Guide, Edition 3
Programming Examples for Visual Basic Users
Multi Channel Sweep Measurement
Measurement
Result Example
Vb (V), Ib (mA), Ic (mA), Time_b (sec), Time_c (sec), Status_b,
Status_c
0.3,0,-0.005,0.0568,0.1427,0,0
0.35,0,-0.005,0.2288,0.3147,0,0
0.4,0,-0.005,0.4008,0.4867,0,0
0.45,0,-0.005,0.5728,0.6587,0,0
0.5,0,0,0.7448,0.8306,0,0
0.55,0.0001,0.015,0.9168,1.0027,0,0
0.6,0.0005,0.085,1.0888,1.1746,0,0
0.65,0.00305,0.605,1.2608,1.3467,0,0
0.7,0.01915,3.89,1.4328,1.5186,0,0
0.75,0.09975,19.625,1.6048,1.6906,0,0
0.8,0.34745,59.38,1.7768,1.8626,0,0
Data save completed.
Do you want to perform measurement again?
Dim fname As String ’data file name ’12
Dim fnum As Integer ’file number
fname = "C:\Agilent\mdata\data4.txt"
fnum = 1
’saves data into the file specified by fname
Open fname For Output Access Write Lock Read Write As fnum
Print #fnum, val
Close fnum
’displays data on a MsgBox
Dim title As String ’22
Dim rbx As Integer
title = "Sweep Measurement Result"
val = val & Chr(10) & Chr(10) & "Data save completed."
val = val & Chr(10) & Chr(10) & "Do you want to perform
measurement again?"
rbx = MsgBox(val, vbYesNo, title)
If rbx = vbYes Then
sweep_meas vi, ret, m()
End If ’30
End Sub
Line Description
12 to 20 Saves measurement data into a CSV file specified by the fname
variable.
22 to 30 Displays measurement data on a message box. If Yes is clicked
on the message box, performs the sweep_meas subprogram
again. If No is clicked, returns to the perform_meas
subprogram.
32 End of the save_data subprogram.