3-26 Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4
Programming Examples for Visual Basic Users
Multi-Channel Sweep Measurements
Sub save_data(nop As Long, md() As Double, st() As Long, sc() As Double, vi As
Long, ret As Long, m() As Long)
’1
Dim i
As Integer
’array counter for primary sweep
’3
Dim val
As String
’data to be saved to a file
val = "Vb (V), Ib (mA), Ic (mA), Status_b, Status_c"
For i = 0 To nop - 1
’7
val = val & Chr(13) & Chr(10) & sc(i) & "," & md(2 * i) * 1000 & ","
val = val & md(2 * i + 1) * 1000 & "," & st(2 * i) & "," & st(2 * i + 1)
Next i
Dim fname As String ’data file name
’12
Dim fnum As Integer ’file number
fname = "C:\Agilent\data\data3.txt"
fnum = 1
’saves data into the file specified by fname
Open fname For Output Access Write Lock Read Write As fnum
’18
Print #fnum, val
Close fnum
’displays data on a MsgBox
Dim title As String
’23
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
’31
End Sub
Line
Description
1
Beginning of the save_data subprogram.
3 to 5
Declares variables, and defines the value.
7 to 10
Creates data to be saved and displayed on a message box.
12 to 20
Saves measurement data into a file (C:\Agilent\data\data3.txt, CSV file).
23 to 31
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.
33
End of the save_data subprogram.
Содержание 4155C
Страница 3: ......
Страница 13: ...1 Installation...
Страница 18: ...1 6 Agilent 4155C 4156C VXIplug play Driver User s Guide Edition 4 Installation Installing VXIplug play Driver...
Страница 19: ...2 Driver Function Reference...
Страница 89: ...3 Programming Examples for Visual Basic Users...
Страница 147: ...4 Programming Examples for Visual Basic NET Users...
Страница 183: ...5 Programming Examples for C Users...
Страница 225: ...6 Programming Examples for VEE Users...
Страница 271: ...7 Sample Application Programs Using VEE...