Last Updated: August 29, 2007
A control program example is provided in this topic which performs each of the steps presented in the Programming the Test Set book.
For more information on the conventions used in the programming examples click here.
Option Explicit On
Option Strict On
Imports Ivi.Visa.Interop
Module modCompleteProgram
Dim ResManager As New ResourceManager
Dim TestSet As New FormattedIO488
Sub CompleteProgram()
'************************************************************************
' Step 1. Reference the IO Library
'************************************************************************
' No code for this step. See Programming the Test Set->Step 1 in the help
' file for details on how to do this.
'************************************************************************
' Step 2. Open the test set connection using the IO library
'************************************************************************
' Open the connection to the test set. Get the "VISA Address" from the
' Agilent Connection Expert (installed with Agilent IO Libraries Suite).
' For example, the "VISA Address" used in this code is "GPIB0::14::INSTR".
TestSet.IO = CType(ResManager.Open("GPIB0::14::INSTR"), IMessage)
'************************************************************************
' Step 3. Initialize the interface and the test set
'************************************************************************
' Clear the interface buffer.
TestSet.IO.Clear()
' Fully preset the test set.
TestSet.WriteString("*RST")
' Clear the error queue.
TestSet.WriteString("*CLS")
'************************************************************************
' Step 4. Set up general operating conditions
'************************************************************************
' Set offset frequencies and set the state to On for the frequencies, offsets and RF Amplitude Offset State.
TestSet.WriteString("SYSTem:CORRection:SFRequency 1710.2 MHZ,1805.2 MHZ,1784.8 MHZ,1879.8 MHZ")
' Set offset values correcting for losses in dB.
TestSet.WriteString("SYSTem:CORRection -2.55,-3.12,-3.68,-4.23")
' Turn the tracking mode to Off.
TestSet.WriteString("DISPlay:MODE:TRACking OFF")
'************************************************************************
' Step 5. Configure test set and wireless device parameters
'************************************************************************
' Set the RF analyzer frequency control to auto.
TestSet.WriteString("RFANalyzer:CONTrol:FREQuency:AUTO:GCALibration ON")
' Set ARFCN to 512 for the PCS band.
TestSet.WriteString("TRANsceiver:CHANnel:DCS 512")
' Set ARFCN to 5 for the EGSM band.
TestSet.WriteString("TRANsceiver:CHANnel:EGSM 5")
' Set ARFCN to 259 for the GSM450 band.
TestSet.WriteString("TRANsceiver:CHANnel:GSM450 259")
' Set active GSM/GPRS band.
TestSet.WriteString("TRANsceiver:BAND:GCALibration DCS")
' Set the RF Generator power state to on and the level to to -70 dBm.
TestSet.WriteString("RFGenerator:POWer:GCALibration -70")
' Set the RF analyzer expected input power control mode to auto.
TestSet.WriteString("RFANalyzer:CONTrol:POWer:AUTO:GCALibration ON")
' Set uplink burst 2 to be measured for single slot measurements.
TestSet.WriteString("RFANalyzer:BURSt 2")
' Set the Mobile Station TX Level for burst 1 in the DCS band to 10.
TestSet.WriteString("RFANalyzer:MS:TXLevel:DCS:BURSt1 10")
' Set the Mobile Station TX Level for burst 2 in the DCS band to 12.
TestSet.WriteString("RFANalyzer:MS:TXLevel:DCS:BURSt2 12")
' Set the test set to expect Training Sequence Code (TSC) 2 in the midamble burst.
TestSet.WriteString("RFANalyzer:BURSt:TYPE TSC2")
'************************************************************************
' Step 6. Set up measurement parameters
'************************************************************************
'
' Configure Power and Modulation Quality Measurement Suite parameters for GSM and GPRS.
'
' Set Power and Modulation Quality suite trigger arm to single.
TestSet.WriteString("SETup:PMODulation:CONTinuous OFF")
' Set Power and Modulation Quality suite multi-measurement count to 100.
TestSet.WriteString("SETup:PMODulation:COUNt 100")
' Set VISA timeout to 10 seconds. This timeout should be longer than the
' following measurement timeout value.
TestSet.IO.Timeout = 10000
' Set Power and Modulation Quality suite timeout to 5 seconds.
TestSet.WriteString("SETup:PMODulation:TIMeout 5S")
' Set the time offsets for the Power versus Time power measurement.
TestSet.WriteString("SETup:PMODulation:PVTime:TIME -28uS,-10uS,321.2uS,552.8uS,570.8uS")
' Set the burst synchronization mode to Midamble.
TestSet.WriteString("SETup:PMODulation:SYNC MIDamble")
' Set the confidence level to 90% and the confidence level state to On.
TestSet.WriteString("SETup:PMODulation:MACCuracy:PFERror:CONFidence 90PCT")
'
' Configure Output RF Spectrum Measurement Suite parameters for GSM and GPRS.
'
' Set output RF spectrum suite trigger arm to single.
TestSet.WriteString("SETup:ORFSpectrum:CONTinuous OFF")
' Set Output RF Spectrum suite timeout to 5 seconds.
TestSet.WriteString("SETup:ORFSpectrum:TIMeout 5S")
' Set the fast measurement state to On for the ORFS Modulation measurement.
TestSet.WriteString("SETup:ORFSpectrum:MODulation:FAST ON")
' Set the number of averages for ORFS modulation and the 30 kHz reference power to 25.
TestSet.WriteString("SETup:ORFSpectrum:MODulation:COUNt 25")
' Configure modulation offset.
TestSet.WriteString("SETup:ORFSpectrum:MODulation:FREQuency 200kHz")
' Set the number of averages for the ORFS Switching measurement to 15.
TestSet.WriteString("SETup:ORFSpectrum:SWITching:COUNt 15")
' Configure switching offsets.
TestSet.WriteString("SETup:ORFSpectrum:SWITching:FREQuency 200kHz,400kHz")
'
' Configure RF Channel Measurement Suite parameters.
'
' Set RF Channel suite trigger arm to single.
TestSet.WriteString("SETup:RFCHannel:CONTinuous OFF")
' Set the state to on and the multi-measurement count value to 150.
TestSet.WriteString("SETup:RFCHannel:COUNt 150")
' Set RF Channel suite timeout to 5 seconds.
TestSet.WriteString("SETup:RFCHannel:TIMeout 5S")
' Set RF Channel suite filter to 1 kHz.
TestSet.WriteString("SETup:RFCHannel:FILTer BWKHZ1")
' Set trigger delay time to 1.5 ms for the 1 kHz filter.
TestSet.WriteString("SETup:RFCHannel:TRIGger:DELay:BWKHZ1 1.5mS")
'************************************************************************
' Step 7. Set up measurement suites
'************************************************************************
' Set the Power and Modulation Quality suite to include Power versus Time,
' Phase and Frequency Error, and Transmit Power measurements.
TestSet.WriteString("SETup:PMODulation:INITiate PVT,PFER,TXP")
' Set the Output RF Spectrum suite to include the ORFS Modulation and ORFS
' Switching measurements.
TestSet.WriteString("SETup:ORFSpectrum:INITiate MODulation,SWITching")
' Set the RF Channel suite to include Channel Power and Frequency Error measurements.
TestSet.WriteString("SETup:RFCHannel:INITiate CPOW,FERR")
'************************************************************************
' Step 8. Make a connection
'************************************************************************
' No code for this step. You need to command the wireless device to synchronize
' to the test set's signal and begin transmitting back an appropriate signal.
' You may also want to make a quick power measurement from the test set's front
' panel to ensure that the connection has been made.
'************************************************************************
' Step 9. INITiate and FETCh measurements
'************************************************************************
' Run the InitiateAndFetchResults() subroutine on the current band and ARFCN.
InitiateAndFetchResults()
'************************************************************************
' Step 10. Re-configure the test set and wireless device connection
' parameters
'************************************************************************
' Set active GSM/GPRS band to GSM450. This will use ARFCN 259 defined previously.
TestSet.WriteString("TRANsceiver:BAND:GCALibration GSM450")
' Set the traffic channel wireless device uplink power control
' level for the GSM450 band to 21.
TestSet.WriteString("RFANalyzer:MS:TXLevel:GSM450:BURSt1 21")
'************************************************************************
' Step 9. INITiate and FETCh measurements
'************************************************************************
' Run the InitiateAndFetchResults() subroutine on the re-configured wireless device
' connection parameters.
InitiateAndFetchResults()
'************************************************************************
' Step 11. End the connection
'************************************************************************
' After you have sent the necessary test mode commands to the wireless device
' to end its transmission, send this preset command to partially preset the
' test set without resetting the parameter values to defaults.
TestSet.WriteString("SYSTem:PRESet3")
' Close IO interface to test set.
TestSet.IO.Close()
Console.WriteLine("Program Complete." & ControlChars.NewLine)
End Sub
Public Sub InitiateAndFetchResults()
Dim FetchPmodulationTrace As Array
Dim FetchPmodulationPferror As Array
Dim FetchPmodulationTxpower As Array
Dim FetchOrfspectrumModulation As Array
Dim FetchOrfspectrumSwitching As Array
Dim FetchRfchannelCpower As Array
Dim FetchRfchannelFerror As Array
Dim TransceiverBandGcalibration As String
Dim TransceiverChannel As Int32
Try
' Initiate the Power and Modulation Quality measurement suite. The measurements specified
' previously using the SETup:PMODulation:INITiate command are all activated.
TestSet.WriteString("INITiate:PMODulation")
' Query the power versus time trace results.
TestSet.WriteString("FETCh:PMODulation:PVTime:TRACe?")
FetchPmodulationTrace = CType(TestSet.ReadList(), Array)
' Query the Phase and Frequency Error measurement results.
TestSet.WriteString("FETCh:PMODulation:MACCuracy:PFERror?")
FetchPmodulationPferror = CType(TestSet.ReadList(), Array)
' Query the average transmit power result.
TestSet.WriteString("FETCh:PMODulation:TXPower?")
FetchPmodulationTxpower = CType(TestSet.ReadList(), Array)
' Initiate the Output RF Spectrum measurement suite. The measurements specified
' previously using the SETup:ORFSpectrum:INITiate command are all activated.
TestSet.WriteString("INITiate:ORFSpectrum")
' Query the ORFS measurement suite integrity, ORFS Modulation pass/fail result,
' 30 kHz reference power, ORFS Modulation number of fetch points,
' and up to 22 ORFS Modulation (average) results.
TestSet.WriteString("FETCh:ORFSpectrum:MODulation?")
FetchOrfspectrumModulation = CType(TestSet.ReadList(), Array)
' Query the ORFS measurement suite integrity, ORFS Switching pass/fail result,
' ORFS Switching number of fetch points, and up to 8 ORFS Switching (maximum) results.
TestSet.WriteString("FETCh:ORFSpectrum:SWITching?")
FetchOrfspectrumSwitching = CType(TestSet.ReadList(), Array)
' Initiate the RF Channel measurement suite. The measurements specified previously using
' the SETup:RFCHannel:INITiate command are activated.
TestSet.WriteString("INITiate:RFCHannel")
' Query the channel power.
TestSet.WriteString("FETCh:RFCHannel:CPOWer?")
FetchRfchannelCpower = CType(TestSet.ReadList(), Array)
' Query the frequency error.
TestSet.WriteString("FETCh:RFCHannel:FERRor?")
FetchRfchannelFerror = CType(TestSet.ReadList(), Array)
' Query the currently set band.
TestSet.WriteString("TRANsceiver:BAND:GCALibration?")
TransceiverBandGcalibration = TestSet.ReadString()
' Query the currently set ARFCN.
TestSet.WriteString("TRANsceiver:CHANnel?")
TransceiverChannel = CType(TestSet.ReadNumber(), Int32)
'***Print measurement results***
Console.WriteLine(ControlChars.NewLine & "Measured Results for:")
Console.Write("Band " & TransceiverBandGcalibration)
Console.WriteLine("ARFCN " & TransceiverChannel)
Console.WriteLine(ControlChars.NewLine & "Power and Modulation Quality Measurement Suite")
Console.WriteLine("----------------------------------------------")
Console.WriteLine(ControlChars.NewLine & "Power and Modulation Quality Suite Integrity Indicator = " & CStr(FetchPmodulationTrace.GetValue(0)))
Console.WriteLine(ControlChars.NewLine & "Power versus Time Results:")
Console.WriteLine("Number of Points Measured = " & CStr(FetchPmodulationTrace.GetValue(1)))
Console.WriteLine("Absolute reference power (dBm) = " & CStr(FetchPmodulationTrace.GetValue(4)))
Console.WriteLine("Trace power values (dBm) = " & CStr(FetchPmodulationTrace.GetValue(5)))
Console.WriteLine(ControlChars.NewLine & "Phase and Frequency Error Results:")
Console.WriteLine("Maximum RMS Phase Error (deg) = " & CStr(FetchPmodulationPferror.GetValue(1)))
Console.WriteLine("Maximum Peak Phase Error (deg) = " & CStr(FetchPmodulationPferror.GetValue(2)))
Console.WriteLine("Worst Frequency Error (kHz) = " & CStr(FetchPmodulationPferror.GetValue(3)))
Console.WriteLine(ControlChars.NewLine & "Transmit Power Results:")
Console.WriteLine("Average Transmit Power (dBm) = " & CStr(FetchPmodulationTxpower.GetValue(1)))
Console.WriteLine(ControlChars.NewLine & "Power and Modulation Quality measurement suite complete." & ControlChars.NewLine)
Console.WriteLine("Output RF Spectrum Measurement Suite")
Console.WriteLine("------------------------------------")
Console.WriteLine(ControlChars.NewLine & "Output RF Spectrum Suite Integrity Indicator = " & CStr(FetchOrfspectrumModulation.GetValue(0)))
Console.WriteLine(ControlChars.NewLine & "ORFS Modulation Results:")
Console.WriteLine("ORFS Modulation Pass/Fail result (0=Pass/1=Fail) = " & CStr(FetchOrfspectrumModulation.GetValue(1)))
Console.WriteLine("30 KHz Reference Power = " & CStr(FetchOrfspectrumModulation.GetValue(2)))
Console.WriteLine("ORFS Modulation Number of Fetch Points = " & CStr(FetchOrfspectrumModulation.GetValue(3)))
Console.WriteLine("ORFS Modulation 200 kHz Offset Frequency Average Power = " & CStr(FetchOrfspectrumModulation.GetValue(4)))
Console.WriteLine(ControlChars.NewLine & "ORFS Switching Results:")
Console.WriteLine("ORFS Switching Pass/Fail result (0=Pass/1=Fail) = " & CStr(FetchOrfspectrumSwitching.GetValue(1)))
Console.WriteLine("ORFS Switching Number of Fetch Points = " & CStr(FetchOrfspectrumSwitching.GetValue(2)))
Console.WriteLine("ORFS Switching 200 kHz and 400 kHz Offset Frequency Maximum Power = " & CStr(FetchOrfspectrumSwitching.GetValue(3)))
Console.WriteLine(ControlChars.NewLine & "Output RF Spectrum measurement suite complete." & ControlChars.NewLine)
Console.WriteLine("RF Channel Measurement Suite")
Console.WriteLine("----------------------------")
Console.WriteLine(ControlChars.NewLine & "RF Channel Suite Integrity Indicator = " & CStr(FetchRfchannelFerror.GetValue(0)))
Console.WriteLine(ControlChars.NewLine & "Channel Power Results:")
Console.WriteLine("Average Channel Power (dBm) = " & CStr(FetchRfchannelCpower.GetValue(1)))
Console.WriteLine("Peak Channel Power (dBm) = " & CStr(FetchRfchannelCpower.GetValue(2)))
Console.WriteLine(ControlChars.NewLine & "Frequency Error Results:")
Console.WriteLine("Frequency Error (Hz) = " & CStr(FetchRfchannelFerror.GetValue(1)))
Console.WriteLine(ControlChars.NewLine & "RF Channel measurement suite complete." & ControlChars.NewLine)
Catch ex As Exception
MessageBox.Show("The following error occurred in the Control Program" & ControlChars.CrLf & ex.Message, "Program Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
End Module