4-24 Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4
Programming Examples for Visual Basic .NET Users
Pulsed Sweep Measurements
Ag415x.Force(t(2), Hp4156b.ModeEnum.VoltageOutput, 0, 0, 0.05, 0)
’39
Ag415x.ErrorQuery(err, msg)
If err <> 0 Then Ag415x.ZeroOutput(0) : GoTo Check_err
For j = 0 To nop2 - 1
Ag415x.SetPiv(t(0), Hp4156b.ModeEnum3.SingleLinearV, 0, base, vc1, vc2, nop1,
hold, width, period, iccomp)
’44
Ag415x.ErrorQuery(err, msg)
If err <> 0 Then Ag415x.ZeroOutput(0) : GoTo Check_err
Ag415x.Force(t(1), Hp4156b.ModeEnum.CurrentOutput, 0, ibo, vbcomp, 0)
’48
Ag415x.SweepPiv(t(0), Hp4156b.ModeEnum1.CurrentMeasurement, 0, rep, sc, md, st)
If rep <> nop1 Then Ag415x.ZeroOutput(0) : GoTo Check_err
For i = 0 To nop1 - 1
’52
data(j, i) = Chr(13) & Chr(10) & ibo * 1000000 & "," & sc(i)
data(j, i) = data(j, i) & "," & md(i) * 1000 & "," & st(i)
Next i
ibo = ibo + d_ib
Next j
Ag415x.ZeroOutput(0)
’60
save_data(fname, title, val, data, nop1, nop2, Ag415x)
Check_err:
’63
If err <> 0 Then MsgBox("Instrument error: " & err & Chr(10) & msg, vbOKOnly, "")
If rep <> nop1 Then MsgBox("No. of data: " & rep & " (not " & nop1 & ")", vbOKOnly,
"")
End Sub
Line
Description
39 to 41
Applies voltage to device and checks if an error occurred. If an error is detected, forces 0
V and goes to Check_err.
44 to 46
Sets the pulsed sweep source and checks if an error occurred. If an error is detected, forces
0 V and goes to Check_err.
48 to 50
Applies voltage to the device and performs pulsed sweep measurement. After that, checks
the number of returned data. If it was not rep= nop1, forces 0 V and goes to Check_err.
52 to 55
Stores the data into the
data
valiable.
60 to 61
Applies 0 V from the all channels. And transfers the data stored in the
data
variable to the
save_data subprogram (see Table 4-1). And the subprogram will save the data into the
C:\Agilent\data\data8.txt file (CSV) and displays the data on a message box.
63 to 65
Displays a message box to show an error message if the error is detected.
Summary of Contents for 4155C
Page 3: ......
Page 13: ...1 Installation...
Page 19: ...2 Driver Function Reference...
Page 89: ...3 Programming Examples for Visual Basic Users...
Page 147: ...4 Programming Examples for Visual Basic NET Users...
Page 183: ...5 Programming Examples for C Users...
Page 225: ...6 Programming Examples for VEE Users...