Specifications

270 Chapter 16
Application Programs
Basic Measurement
1400|
1410| ' STEP8: Auto Scaling & Maximum Point Search
1420|
1430| ' Performing a Single Sweep
1440|
1450| SCPI.Output "CALC:AVER:CLE"
1460| Answer = SingleMeasure
1470| If Answer = 0 Then
1480| MsgBox "A single sweep aborted", vbOKOnly, "Impedance
measurement"
1490| GoTo Prog_int
1500| End If
1510|
1520| ' Performing an Auto-scale
1530|
1540| Auto_scaling:
1550| SCPI.Output "DISP:TRAC1:Y:AUTO"
1560| SCPI.Output "DISP:TRAC2:Y:AUTO"
1570| SCPI.Output "DISP:TRAC3:Y:AUTO"
1580|
1590| ' Searching the Maximum Value
1600|
1610| SCPI.Output "CALC1:MARK1 ON"
1620| SCPI.Output "CALC1:MARK1:ACT"
1630| SCPI.Output "CALC1:MARK:FUNC " & Mkr_src
1640| SCPI.Output "CALC1:MARK:FUNC:EXEC"
1650|
1660| ' Reading a marker's value
1670|
1680| SCPI.Output "CALC1:MARK1:X?"
1690| SCPI.Enter Freq_val
1700| SCPI.Output "CALC1:MARK1:Y?"
1710| SCPI.Enter Imp_val
1720|
1730| ' Displaying Measurement Result
1740|
1750| Reply = Message("Frequency: " & CStr(Freq_val /
1000000#) & "[MHz]" & _
1760| vbCrLf & "Impedance: " & CStr(Imp_val)
& "[ohm]" & _
1770| vbCrLf & vbCrLf & "Performing a
measurement again?")
1780| If Reply = 0 Then GoTo Meas_start
1790| MsgBox "Program ended!", vbOKOnly, "Impedance
measurement"
1800| GoTo Prog_end
1810|
1820| Prog_int:
1830| MsgBox "Program interruption", vbOKOnly, "Impedance
measurement"
1840|
1850| Prog_end:
1860|
1870| Set Err.Evnt = Nothing
1880|
1890| End Sub
1900|
1910| Function Cal(Standard As String) As Integer