Other topics about Sample Programs
This sample program demonstrates how to configure measurement conditions.
The program resets the instrument and then configures it with the following conditions:
Active table number: 3
Point number for single-point measurement: 1
Measurement point setup table:
Point number |
Measuring frequency |
Averaging factor |
Signal source level |
1 |
1 MHz |
2 |
-10 dBm |
2 |
10 MHz |
2 |
-10 dBm |
3 |
100 MHz |
2 |
-10 dBm |
4 |
1 GHz |
2 |
-10 dBm |
Settings of Measurement Parameters 1 through 4:
Parameter |
Display |
Deviation mode |
|||
On/Off |
How parameter is displayed |
Reference value |
|||
Measurement parameter 1 |
Ls |
On |
On |
Percentage |
100 nH |
Measurement parameter 2 |
Rs |
On |
On |
Absolute value |
10 Ω |
Measurement parameter 3 |
Q |
On |
Off |
- |
- |
Measurement parameter 4 |
- |
Off |
- |
- |
- |
List measurement: On
Display parameters for list measurement screen
Display item 1: Measuring frequency
Display item 2: Measuring parameter (Ls)
Display item 3: Measuring parameter (Rs)
Display item 4: Measuring parameter (Q)
Result of test signal current level monitoring: On
Result of test signal voltage level monitoring: On
Rdc measurement: On
Rdc measurement limit range
Lower limit: -5 Ω
Upper limit: 5 Ω
Title display area: On
Time and date display: On (auto update)
See these topics for this programming:
Sub MeasurementConditions()
'*** The variables of the resource manager and the instrument I/O are declared
Dim ioMgr As VisaComLib.ResourceManager
Dim Age4982x As VisaComLib.FormattedIO488
'*** The memory area of the resource manager and the instrument I/O are acquired
Set ioMgr = New VisaComLib.ResourceManager
Set Age4982x = New VisaComLib.FormattedIO488
'*** Open the instrument & Sets the GPIB address
Set Age4982x.IO = ioMgr.Open("GPIB0::17::INSTR")
Age4982x.IO.timeout = 30000 ' Timeout time should be greater than the measurement time.
'*** Variable declaration
Dim Unit, List, Rdc As String
Dim Para(4) As String
Dim Dev(4) As String
Dim List_lab(4) As String
Dim Title, Title_disp, Clock_disp As String
Dim Freq(4), Pow(4), Cent(4), Rdc_l_lim, Rdc_u_lim As Double
Dim Ave(4), Act_tab, Nop, Point_no, i As Integer
Dim Imon_disp, Vmon_disp As String
'*** Set variables
'* Stores the active table number, the point number for single-point measurement,
'* the unit of the signal source level, and the number of measurement points into the Act_tab,
'* Point_no, Unit, and Nop variables, respectively.
Act_tab = 3 '* Active Table Number: 3
Point_no = 1 '* Selected POint No.: 1
Unit = "DBM" '* Power level unit: dBm
Nop = 4 '* Number of Points: 4
'* Stores the frequency, averaging factor, and signal source level at each
'* point into the Freq(*), Ave(*), and Pow(*) variables respectively.
Freq(1) = 1000000# '* Point No.1 Frequency: 1 MHz
Ave(1) = 2 '* Averaging Factor: 2
Pow(1) = -10 '* OSC Level: -10 dBm
Freq(2) = 10000000# '* Point No.2 Frequency: 10 MHz
Ave(2) = 2 '* Averaging Factor: 2
Pow(2) = -10 '* OSC Level: -10 dBm
Freq(3) = 100000000# '* Point No.3 Frequency: 100 MHz
Ave(3) = 2 '* Averaging Factor: 2
Pow(3) = -10 '* OSC Level: -10 dBm
Freq(4) = 1000000000# '* Point No.4 Frequency: 1 GHz
Ave(4) = 2 '* Averaging Factor: 2
Pow(4) = -10 '* OSC Level: -10 dBm
'* Stores the parameter settings, deviation mode settings, and reference values
'* for measurement parameters 1 through 4 into the Para(*), Dev(*), and Cent(*) arrays, respectively.
Para(1) = "LS" '* Measurement Parameter Para.1: Ls
Para(2) = "RS" '* Para.2: Rs
Para(3) = "Q" '* Para.3: Q
Para(4) = "OFF" '* Para.4: Display off
Dev(1) = "PCNT" '* Deviation Mode Para.1: ON (Pcnt)
Dev(2) = "DEV" '* Para.2: ON (Dev)
Dev(3) = "OFF" '* Para.3: OFF
Dev(4) = "OFF" '* Para.4: OFF
Cent(1) = 0.0000001 '* Reference Value Para.1: 100 nH
Cent(2) = 10 '* for Deviation Mode Para.2: 10 ohm
Cent(3) = 0 '* Para.3: Dummy
Cent(4) = 0 '* Para.4: Dummy
'* Stores the ON/OFF setting of list measurement into the List variable.
List = "ON" '* List Measurement: ON
'* Stores the parameter selections for display items 1 through 4 on the list
'* measurement screen into the List_lab(*) array.
List_lab(1) = "FREQ" '* Displays Parameter Label-1: Freq
List_lab(2) = "PAR1" '* for List Measurement Label-2: Para.1
List_lab(3) = "PAR2" '* Label-3: Para.2
List_lab(4) = "PAR3" '* Label-4: Para.3
'* Stores the ON/OFF settings for the results of test signal current and
'* voltage monitoring into the Imon_disp$ and Vmon_disp$ variables.
Imon_disp = "ON" '* Test Signal Level Monitor Current Display: On
Vmon_disp = "ON" '* Voltage Display: On
'* Stores the ON/OFF setting of Rdc measurement and the upper and lower limits
'* for the Rdc measurement limit range into the Rdc, Rdc_l_lim, and Rdc_u_lim variables, respectively.
Rdc = "ON" '* Rdc Measurement = On
Rdc_l_lim = -5 '* Rdc Measurement Lower Limit: -5 ohm
Rdc_u_lim = 5 '* Comparator Function Upper Limit: +5 ohm
'* Stores the ON/OFF setting of the title display, title string, and the setting of
'* the time display into the Title_disp, Title, and Clock_disp variables, respectively.
Title_disp = "ON" '* Title Display Area Display: On
Title = "Example 3-1" '* Title: Example 3-1
Clock_disp = "LIVE" '* Time and Date Display: ON (Live)
'* Resets the instrument.
Age4982x.WriteString ":SYST:PRES" + vbLf, True
'*** Measurement Point Setup Table
'* Sets the active table number to Act_tab and the unit of the signal source level to Unit.
Age4982x.WriteString ":SOUR:LIST:TABL " & Act_tab, True
Age4982x.WriteString ":SOUR:UNIT " & Unit, True
'* Configures the measurement point setup table.
Age4982x.WriteString ":SOUR:LIST " & Nop & ",", False
For i = 1 To Nop - 1
Age4982x.WriteString Freq(i) & "," & Ave(i) & "," & Pow(i) & ",", False
Next i
Age4982x.WriteString Freq(Nop) & "," & Ave(Nop) & "," & Pow(Nop), True
'*** Measurement Parameter
'* Configures the instrument with the various settings related to measurement parameters 1 through 4.
For i = 1 To 4
If Para(i) = "OFF" Then
Age4982x.WriteString ":DISP:TEXT1:CALC" & Val(i) & " OFF", True
Else
Age4982x.WriteString ":DISP:TEXT1:CALC" & Val(i) & " ON", True
Age4982x.WriteString ":CALC:PAR" & Val(i) & ":FORM " & Para(i), True
If Dev(i) = "OFF" Then
Age4982x.WriteString ":CALC:PAR" & Val(i) & ":EXPR:STAT OFF", True
Else
Age4982x.WriteString ":CALC:PAR" & Val(i) & ":EXPR:STAT ON", True
Age4982x.WriteString ":CALC:PAR" & Val(i) & ":EXPR:NAME " & Dev(i), True
Age4982x.WriteString ":CALC:PAR" & Val(i) & ":EXPR:CENT " & Cent(i), True
End If
End If
Next i
'*** Measurement Point(s)
'* Turns ON/OFF list measurement based on List and sets the point number
'* for single-point measurement to Point_no
Age4982x.WriteString ":SOUR:LIST:POIN " & Point_no, True
Age4982x.WriteString ":SOUR:LIST:STAT " & List, True
'*** Test Signal Level Monitor Result Display
'* Turns ON/OFF the results of test signal level current and voltage
'* monitoring based on Imon_disp and Vmon_disp.
Age4982x.WriteString ":DISP:TEXT1:CALC11 " & Imon_disp, True
Age4982x.WriteString ":DISP:TEXT1:CALC12 " & Vmon_disp, True
'*** Rdc Measurement
'* Turns ON/OFF Rdc measurement based on Rdc$ and set the limit range
'* for Rdc measurement to the range between Rdc_l_lim and Rdc_u_lim.
Age4982x.WriteString ":SOUR:LIST:RDC " & Rdc, True
Age4982x.WriteString ":CALC:COMP:RDC:LIM " & Rdc_l_lim & "," & Rdc_u_lim, True
'*** Displayed Parameter in List Measurement Display
'* Configures display items 1 through 4 on the list measurement screen.
For i = 1 To 4
Age4982x.WriteString ":DISP:TEXT2:LAB" & Val(i) & " " & List_lab(i), True
Next i
'*** Title Display area
'* Turns ON/OFF the title display based on Title_disp and sets the title to Title.
Age4982x.WriteString ":DISP:TEXT10 " & Title_disp, True
Age4982x.WriteString ":DISP:TEXT10:DATA """ & Title & """", True
'*** Clock (Data/Time) Display
'* Configures the date and time display.
If Clock_disp = "OFF" Then
Age4982x.WriteString ":DISP:TEXT11 OFF", True
Else
Age4982x.WriteString ":DISP:TEXT11 ON", True
Age4982x.WriteString ":DISP:TEXT11:MODE " & Clock_disp, True
End If
MsgBox ("End of ""Measurement Condition"" program"), vbOKOnly
End Sub