Agilent Technologies B1500A Podręcznik Użytkownika Strona 116

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 208
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 115
3-22 Agilent B1500 VXIplug&play Driver User’s Guide, Edition 3
Programming Examples for Visual Basic Users
Staircase Sweep Measurement
Sub save_data(nop1 As Long, nop2 As Long, dvg() As Double, md() As Double, st() As
Long, sc() As Double, tm() As Double, vi As Long, ret As Long, m() As Long)
Dim i As Integer ’array counter for primary sweep ’3
Dim j As Integer ’array counter for secondary sweep
Dim val As String ’data to be saved to a file
val = "Vg (V), Vd (V), Id (mA), Time (sec), Status"
For j = 1 To nop2 ’8
For i = nop1 * (j - 1) To nop1 * j - 1
val = val & Chr(13) & Chr(10) & dvg(j - 1) & "," & sc(i) & "," & md(i) *
1000 & "," & tm(i) & "," & st(i)
Next i
Next j ’12
Dim fname As String ’data file name ’14
Dim fnum As Integer ’file number
fname = "C:\Agilent\mdata\data1.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 ’22
’displays data on a MsgBox
Dim title As String ’24
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() ’returns to sweep_meas if Yes is clicked.
End If ’32
End Sub
Line Description
1 Beginning of the save_data subprogram.
3 to 6 Declares variables, and defines the value.
8 to 12 Creates data to be saved and displayed on a message box.
14 to 22 Saves measurement data into a CSV file specified by the fname variable.
24 to 32 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.
34 End of the save_data subprogram.
Przeglądanie stron 115
1 2 ... 111 112 113 114 115 116 117 118 119 120 121 ... 207 208

Komentarze do niniejszej Instrukcji

Brak uwag