Programming Format Conventions................................................................................................................................................. 1-2
If you have Agilent Technologies 8922M/S Option 010................................................................................................................1-3
Units of Measure............................................................................................................................................................................. 1-4
Exercise A - Establishing a Link ....................................................................................................................................................2-3
Example B - Controlling the Mobile ..............................................................................................................................................2-4
Example C - Making Measurements .............................................................................................................................................. 2-6
Example D - Adding Robustness.................................................................................................................................................. 2-11
Example E - Faster Testing........................................................................................................................................................... 2-12
GPIB Commands Used in Exercises.............................................................................................................................................2-14
Example Programs........................................................................................................................................................................2-16
Program 1...................................................................................................................................................................................... 2-19
Program 2...................................................................................................................................................................................... 2-29
Program 3...................................................................................................................................................................................... 2-40
Transient Settling Times ..............................................................................................................................................................2-50
Contents
3 AF Analyzer Subsystem
AIN .................................................................................................................................................................................................3-4
TCH1 or TCH2:ARFCn................................................................................................................................................................ 9-20
TCH1 or TCH2:MALLocation.....................................................................................................................................................9-20
TCH1 or TCH2:MODE ................................................................................................................................................................ 9-20
TCH1 or TCH2:TSLot..................................................................................................................................................................9-21
TCH1 or TCH2:TYPE..................................................................................................................................................................9-21
DATE ............................................................................................................................................................................................10-8
DATA <data entry>.......................................................................................................................................................................16-4
FORMat ........................................................................................................................................................................................ 17-3
RFANalyzer or RFGenerator:CTENd...........................................................................................................................................20-6
RFANalyzer or RFGenerator:DELete...........................................................................................................................................20-6
RFANalyzer or RFGenerator:FREQuency ...................................................................................................................................20-6
RFANalyzer or RFGenerator:INSert............................................................................................................................................ 20-7
RFANalyzer or RFGenerator:MODE...........................................................................................................................................20-7
RFANalyzer or RFGenerator:SETTling.......................................................................................................................................20-7
RFANalyzer or RFGenerator[:TRIGger]:ASTate......................................................................................................................... 20-8
*ESE (Event Status Enable) ......................................................................................................................................................... 21-3
*ESR? (Event Status Register) ....................................................................................................................................................21-4
MESS1 or MESS2:CODE ............................................................................................................................................................ 34-4
MESS1 or MESS2:UPDate .......................................................................................................................................................... 34-4
MESS1 or MESS2:IDENtifier......................................................................................................................................................34-5
MESS1 or MESS2:LANGuage .................................................................................................................................................... 34-5
Status Subsystem - Status Byte..................................................................................................................................................... 37-3
Rules and guidelines for using General Purpose Interface Bus (GPIB)
programming are contained in this chapter. Chapters 3 and onwards outline each
GPIB command subsystem used with the Agilent 8922M/S.
Each subsystem chapter starts with a syntax diagram followed by a simple
explanation of each command within that subsystem.
1-1
Command Guidelines
Command Names
Command Names
Generally all commands of greater than four characters havean alternate abbreviatedform
using only the upper case letters and number (if used).
Upper or lower case characters may be used for all commands.
For example, to set the amplitude of RF Generator 1, you could use any of the following
commands:
RFGENERATOR:AMPLITUDE1 -10DBM or
RFGenerator:AMPLitude1 -10DBM
rfgenerator:amplitude1 -10DBM or
rfg:ampl1 -10DBM or
RFG:AMPL1 -10DBM
Programming Format Conventions
Syntax commands and returned data descriptions use the following format conventions.
Upper case
letters
Square
brackets
Vertical bar|,indicatesthatone-and-only-oneitemseparatedbytheverticalbar can be used at any given
Question
mark
Quoted string Fields that accept quoted string parameters will return the active choice in quotes when
Decimal
numeric data
Floating
numeric data
Indicate the shortened acceptable form of a command.
[ ], indicate that enclosed command or command parameters are optional.
time. The verticalbar is read as “or.”For example,‘A’ | ‘B’ indicates that either A or B can
be chosen, but not both.
?, indicates a query command. Most commands accept this command when it is entered
immediately after the command name. The returned information (<value>) varies in format
according to the type of the field.
queried. For example if the RF generator Output was set to the RF IN/OUT parameter
(RFG:OUTP “RF IN/OUT”) and the queried (RFG:OUTP?), the return would be “RF IN/
OUT”.
Fields that accept decimal numeric data will return the current field value as an
exponentiated decimal number.
Fields that accept floating pointnumeric data will return thecurrent field value as a floating
point number in the current
Character
data
GPIB units.
Fields that accept character data (unquoted strings) will return the queried information
without quotes.
1-2
Command Guidelines
If you have Agilent Technologies 8922M/S Option 010
Quotation
marks
“ ”, enclose command and string entries. Be sure to follow the correct syntax for using
quotations that are specific to your basic language.
Colons:, are used to separate keywords and show hierarchical relationship.
”RFANalyzer:FREQuency 935 MHz”
A Semicolon
and a Colon
;:, are used to separate two or more root level command statements on the same line.
”RFAN:INP ’RF IN/OUT’;:RFAN:AMPL1 −20 dBm”.
Semicolons;, can also be used to condense command words on one line if the commands are equal, or
of decreasing hierarchy under the keyword. (The following example is equivalent to the
previous command statement, but the root level keyword :RFAN is removed by using
semicolons.)
”RFAN:INP ’RF IN/OUT’;AMPL1 −20 dBm”
CommasAre used to separate multiple parameter entries.
Angle
< >, enclose variable items that represent user choices (parameters) to be entered.
brackets
If you have Agilent Technologies 8922M/S Option 010
If you have the Agilent 8922M/S Option 010 Multi-Band Test System, you will have
access to some additional GPIB commands.
Refer to the Agilent 8922 Multi-Band User’s Guide for a full description of these
commands. The additional commands are either part of a current subsystem or are part of
the new Dual Band Control subsystem.
The Agilent 8922 Multi-Band User’s Guide gives a programming example of the Dual
Band Control GPIB commands.
1-3
Command Guidelines
Units of Measure
Units of Measure
Units for measurements
Units for settings These are implemented such that if a unit is not sent along with the
These are implemented such that a measurement query result will be
returned in the current GPIB unit.
setting value, then a default GPIB unit is used.
•For example, RFGenerator:AMPLitude1 assumes dBm and
RFGenerator:FREQuency assumes Hz. If a unit is sent with the
setting, then this unit will be used. The GPIB unit may be
changed using the units commands described later.
•Each measurement or setting description defines the allowable
units for that field. When units are sent with a command, they
should not be quoted.
The complete allowable set of GPIB units that setting queries or
measurement queries may be returned in are:
• V (volt), W (watts)
The complete allowable set of units that can be sent with setting
commands or units that can be displayed on the front panel are:
• DB (dB), DBM (dBm), DBMW (dB milli-watt), DBUV(dB microvolt),
• HZ (Hz), KHZ (kHz), MHZ (MHz), GHZ (GHz),
• T (bit periods), S (second), MS (milli-second), US (microsecond),
• V (volt), MV (millivolt), UV (microvolt),
• W (watts), MW (milliwatt),
• PCT (percent), PPM (parts-per-million),
• DEG (degree) DIV (division), OHM (ohm)
1-4
Measurement Subsystems
Measure Subsystem
Commands
Measure commands are used to control measurements and get back
the value of the displayed measurement. To get a valid measurement,
the instrument must first be set up to access the desired measurement.
In most cases, this means that you must be on the screen (or set of
screens) associated with the measurement. For example, to retrieve
Output RF Spectrum measurement results, you must be on the Output
RF Spectrum ’Main’ screen or ’Trace’ screen. (See the DISPlay
subsystem commands.) The Trigger commands are then used tocause
a measurement to occur. Once a measurement result is available it
may be queried.
Command Guidelines
Measurement Subsystems
Syntax Diagrams
Each GPIB Subsystem chapter starts with a syntax diagram. This diagram uses a graphical
format to represent the hierarchical structure of a subsystem. The diagram also indicates
possible options and references to other command sets.
The following describes two graphical conventions used in the syntax diagrams.
Sp
:
Means a space must be used as part of the command line. For
example;
AFAN:AIN<space>‘GND’
Represents a colon in the command line.
AFAN:AIN ‘GND’
1-5
Command Guidelines
Optional Commands
Optional Commands
The following lists the optional command groups that are used with many of the GPIB
Command Subsystems. The list describes the abbreviation used for each optional set and
its corresponding Appendix, that gives more details of the options available.
Optional
Command
Abbreviation
[:INUM]Appendix AIncrement integer numeric fields
[:FNUM]Appendix BFloating point numeric field
[:FNUM-MOD]Appendix CFloating point numeric field without INCR:MODE
[:MM]Appendix DMeasurement fields
[:MM-MOD]Appendix EMeasurement fields without units commands
[:AVG]Appendix FMeasurement fields that use averaging
[:MET]Appendix GMeasurement fields that use meters
[:MULTI-B]Appendix HMeasurement fields that use Multi Burst measure-
Examples;
RFGenerator:AMPLitude1 <real> | [:FNUM]
When this command appears in a program it can be written as follows;
The Agilent 8922M/S makes the modulation reference measurement of the Output RF
Spectrum (ORFS) due to modulation test based on a single burst measurement. If you
wish to comply with the GSM Recommendation 11.10, then the following information
will be of interest.
The spectrum due to modulation portion of the GSM ORFS recommendation specifies
maximum levels of power, measured at given frequency offsets from the nominal carrier
frequency, relative to a reference measurement at the carrier frequency. The
recommendation calls for the reference measurement and all other measurements to be
averaged over 200 bursts.
To get averaged ORFS due to modulation measurement results relative to an averaged
reference as in GSM Recommendation 11.10, refer to the following example GPIB script:
!Make 200 modulation measurements at 0 kHz offset and average them.
!This result is the correction factor to the single Modulation
!Reference measurement done earlier.
OUTPUT Gpib;”ORFSpectrum:MODE ‘MODULATN’”
OUTPUT Gpib;”ORFSpectrum:FREQuency:OFFSet 0 KHZ”
OUTPUT Gpib;”DISPlay:ORFSpectrum:VIEW ‘TRACE’”
OUTPUT Gpib;”MEASure:ORFSpectrum:POWer:AVERage:VALue 200”
OUTPUT Gpib;”MEASure:ORFSpectrum:POWer:AVERage:STATe ON”
OUTPUT Gpib;”TRIGger:MODE ‘CONT’”
WAIT 150
!The Agilent 8922M/S makes about 2 measurements per second.
!The Agilent 8922S must be allowed about 1600 seconds.
!This wait allows at least the needed 200 measurements
!to occur for averaging per GSM Recommendations.
OUTPUT Gpib;”MEASure:ORFSpectrum:POWer?”
ENTER Gpib;Correction$
OUTPUT Gpib;”TRIGger:MODE ‘SINGLE’”
OUTPUT Gpib;”MEASure:ORFSpectrum:POWer:AVERage:STATe OFF”
!Enter the correction factor as the Reference value ( REF SET ) for the
!following measurements.
!The ORFS Modulation measurement is now ready for use.
!Do not forget to use averaging.
1-8
2
GPIB Tutorial and Examples
This Chapter introduces the user to automatic GSM mobile phone testing using the
Agilent 8922M and Agilent 8922S GSM Test Set. GPIB (IEEE 488.2) is used in
conjunction with BASIC programming exercises and example programs to illustrate the
most effective techniques for efficient and high speed phone tests.
2-1
GPIB Tutorial and Examples
GPIB Programming Exercises
GPIB Programming Exercises
Before Starting
Power-up the Agilent 8922M/S and carry out the following checks before beginning the
exercise:
❒ On the rearpanel, the OPT 001 REF OUT should be connected with ashort BNC cable
to the REF IN connector.
❒ Use the front panel knob to select the CONFIG screen. Check the Compatible field is
set to 8922M or 8922S.
❒ On the CONFIG screen, set the GPIB address to 14 and check the GPIB mode is set to
talk&lstn.
❒ Connect the GPIB cable from your computer to the Agilent 8922M/S.
❒ Load a Test SIM (Subscriber ID Module) in the mobile.
❒ Connect a GSM mobile to the Agilent 8922M/S front panel RF IN/OUT connector.
Carry out the following programming exercises, check your program works after each
exercise.
2-2
GPIB Tutorial and Examples
Exercise A - Establishing a Link
Exercise A - Establishing a Link
Originate a Call
Begin the program by setting the GPIB address variable Uut=714, then select commands
from section “GPIB Commands Used in Exercises” to carry out the following actions:
❒ Preset the Agilent 8922M/S and set up the paging IMSI and external cable loss, zero
the power meter.
❒ Page the mobile.
❒ Establish a program loop to wait for the mobile to answer the call.
❒ End the loop when the mobile answers or when too much time has elapsed.
Tips:
The BASIC REPEAT UNTIL loop is useful in this application. The loop can be used to
keep checking the Agilent 8922M/S call status until the returned variable becomes equal
to “CONNECTED” or a time-out counter is exceeded. Place a WAIT 1 statement inside
the loop so that the Agilent 8922M/S call status is checked once per second. For more
help, look at the ‘PAGE THE MOBILE AND ESTABLISH A CALL’ section of example
program 1 in section “Example Programs”.
End the Call
Add additional lines to your program to end the call. Select the GPIB commands from
“GPIB Commands Used in Exercises” and use the same structure as for call set up. This
time, wait for the status to become equal to “INACTIVE”.
Tips:
For help, look at the “END THE CALL” section of example program 1 in section
“Example Programs”.
2-3
GPIB Tutorial and Examples
Example B - Controlling the Mobile
Example B - Controlling the Mobile
Mobiles need to be tested on a variety of frequency channels (ARFCN) and transmitter
power levels (TX Level). The Agilent 8922M/S uses over-the-air signalling to command
the mobile to any ARFCN or TX Level. ARFCN changes can be made using channel
assignments, with the signalling taking place over the GSM Fast Associated Control
Channel (FACCH). TX Level changes are signalled using the GSM Slow Associated
Control Channel (SACCH). The choice of FACCH or SACCH has been made by the
GSM specifications.
Before extending your program to control the mobile, press the LOCAL key on the
Agilent 8922M/S and manually establish a call with the mobile. In the MOBILE PHONE
section of the Cell Control screen, use the knob to select TX Level. Using the arrow keys,
quickly change the TX Level from 15, to 14, to 13, to 12, to 10, to 9, to 8, to 7, to 6, to 5
and back down to 15. Notice the mobile’s uplink SACCH reports of TX Level in the
CELL STATUS area of the screen. Notice also the Peak Power measurement in the centre
of the screen. Observe the sequence of events, first you command a new TX Level, about
1 second later, the mobile changes its output power, and shortly after, confirms the new
TX Level on the uplink SACCH, to be displayed on the Agilent 8922M/S.
The sequence for ARFCN changes is similar. Because channel assignments use the
FACCH, the process happens more quickly. There is still a perceptible delay from the
channel change being commanded, by changing the Channel value under MOBILE
PHONE, to the TRAFFIC Channel value being confirmed under CELL STATUS.
TX Level Changing
Extend your program, selecting GPIB commands from section “GPIB Commands Used in
Exercises”, to cycle the mobile’s TX Level from 5 to 15 with the following steps:
❒ Establish call as in exercise A.
❒ Set up a loop to count through the TX Levels.
❒ Command the phone to the new TX Level.
❒ Check the reported TX Level, loop until the reported value matches the programmed
value, or too much time has elapsed.
❒ Repeat for the next TX Level.
❒ End call as in Exercise A.
2-4
GPIB Tutorial and Examples
Example B - Controlling the Mobile
Tips:
The BASIC FOR NEXT loop is ideal for controlling the TX Levels. For example, startthe
loop with FOR Txlevel = 5 TO 15 and end with NEXT Txlevel. Use a REPEAT UNTIL
structure to check the reported TX Level. This time, use a delay of WAIT 0.4. For more
help, look at the ‘PERFORM FAST POWER MEASUREMENTS’ section of example
program 1 in section “Example Programs”.
ARFCN Changing
Once your program is working, add another FOR NEXT loop outside the Txlevel loop to
change ARFCN from 1, to 63, to 124. The new program will cycle the mobile from TX
Level5 to 15 at ARFCN 1, then from 5 to 15 on ARFCN 63, then from 5 to 15 on ARFCN
124. Add a PRINT statement to display the ARFCN and TX Level.
The flow of the mobile control part of the program will be as follows:
❒ Establish call as in exercise A.
❒ Set up a loop to count through three ARFCN.
❒ Command the phone to the new ARFCN.
❒ Check the reported ARFCN, loop until the reported value matches the programmed
value, or too much time has elapsed.
❒ Set up a loop to count through the TX Levels.
❒ Command the phone to the new TX Level.
❒ Check the reported TX Level, loop until the reported value matches the programmed
value, or too much time has elapsed.
❒ Print the ARFCN and TX Level.
❒ Repeat for the next TX Level.
❒ Repeat for the next ARFCN.
❒ End call as in Exercise A.
Tips:
Use a REPEAT UNTIL loop as before to check for confirmation of the mobile’s channel
change, this time use a WAIT 0.1 inside the loop. It may be helpful to use an array to hold
the ARFCN. For example Arfcnar(1)=1, Arfcnar(2)=63, Arfcnar(3)=124, then FOR X=1
TO 3 and Arfcn=Arfcnar(X). For more help, look at the ‘PERFORM FAST POWER
MEASUREMENTS’ section of example program 1 in section “Example Programs”.
2-5
GPIB Tutorial and Examples
Example C - Making Measurements
Example C - Making Measurements
In this section we first add a TX Power measurement, then modulation accuracy and
receiver sensitivity tests.
TX Power Measurement
TX peak power is measured using the Fast TX Carrier Power measurement. This
measurement can take place in parallel with GSM signalling operations such as ARFCN
or TX Level changes. TX peak power is normally displayed on the Cell Control screen.
The Agilent 8922M/S RF Analyser automatically adjusts its input attenuation and gain to
match the power expected from the mobile. The Expected Input power is displayed at the
bottom of the Cell Control screen. This expected power provides a convenient
comparison with the measured power. For a perfect mobile, the expected and measured
values are the same. Select GPIB commands from section “GPIB Commands Used in
Exercises” to query the measured and expected power and insert them immediately before
the PRINT statement in your program. Modify the PRINT statement to display ARFCN,
TX Level, Expected Power and Measured Power. The program flow should be as follows:
❒ Establish call as in exercise A.
❒ Set up a loop to count through three ARFCN.
❒ Command the phone to the new ARFCN.
❒ Check the reported ARFCN, loop until the reported value matches the programmed
value, or too much time has elapsed.
❒ Set up a loop to count through the TX Levels.
❒ Command the phone to the new TX Level.
❒ Check the reported TX Level, loop until the reported value matches the programmed
value, or too much time has elapsed.
❒ Query the Fast TX Carrier Power (TX Peak Power).
❒ Query the RF Analyser Expected Input.
❒ Print the ARFCN, TX Level, Expected Power, Measured TX Peak Power.
❒ Repeat for the next TX Level.
❒ Repeat for the next ARFCN.
❒ End call as in Exercise A.
2-6
GPIB Tutorial and Examples
Example C - Making Measurements
Tips:
For help, look at the “PERFORM FAST POWER MEASUREMENT” section of example
program 1.
DSP Measurements
Modulation accuracy for GSM is determined by measuring the phase and frequency error.
The Agilent 8922M/S uses its DSP analyser for making this measurement. When
triggered, the DSP analyser samples a single GSM TDMA burst and performs several
measurements in parallel namely: peak phase error, rms. phase error, frequency error,
power versus time, data bit display, burst timing and TX peak power. The DSP analyser
shares measurement hardware with the Agilent 8922M/S real-time demodulator. The
hardware can be switched from one mode to another, either making measurements or
demodulating. The demodulator is used to decode the traffic channel and control channel
data being transmitted by the mobile on the up-link. This control information includes the
FACCH and SACCH used for changing ARFCN and TX Level. For this reason, different
techniques are used for ARFCN and TX Level changing while performing DSP
measurements.
TX Level changes are signalled on the down-link SACCH. When the level change is
complete, the mobile signals the new TX Level on the up-link SACCH. The
Agilent 8922M/S does not need to decode this message for the level change to operate
correctly. For TX Level changes, the DSP analyser can remain configured for
measurements and does not need to re-configured for demodulation. However, the up-link
SACCH reports, used in our program to confirm the TX Level change, are not being
demodulated and so are not available to read.
ARFCN changes are signalled using the FACCH. In order for the channel assignment to
work correctly,a two-way exchange of messages has to take place between the mobile and
the Agilent 8922M/S. This requires the DSP analyser to be configured for demodulation.
When an ARFCN change is requested during a DSP measurement, the DSP analyser is
automatically re-configured for demodulation, the channel assignment is performed, once
complete, the DSP analyser is configured for measurements once more.
Single trigger mode is most suitable for DSP measurements over GPIB. ARFCN changes
can be accomplished simply by programming the new ARFCN and triggering the DSP
measurement. The measurement will begin only once the channel change has been
completed. TX Level changes are accomplished by programming the new TX Level then
triggering the DSP measurement. Since the DSP measurement takes 200 to 300
milliseconds to be initialised and sample a TDMA burst, there is a reasonable probability
that in many cases the mobile will have changed level in time for the first measurement.
Checking the measured TX power is close to the expected power provides confirmation
that the TX Level change has been performed. If the measured power is different from the
expected power, the DSP measurement can be performed up to two additional times. The
time taken for three DSP measurements exceeds the time allowed for a mobile to make a
TX Level change.
2-7
GPIB Tutorial and Examples
Example C - Making Measurements
Select commands from section “GPIB Commands Used in Exercises” to create the
following program flow:
❒ Select single trigger mode for DSP measurements.
❒ Establish call as in exercise A.
❒ Perform TX peak power test on channels 1, 63, 124, levels 5 to 15 with code from
exercise B and C.
❒ Display the DSP analyser phase and frequency error screen.
❒ Set up a loop to count through three TX Levels: 5, 10 and 15.
❒ Command the phone to the new TX Level.
❒ Set up a loop to count through three ARFCN: 1, 63, 124.
❒ Command the phone to the new ARFCN.
❒ Trigger a DSP measurement.
❒ Query the peak phase error and rms. phase error.
❒ Query the frequency error and TX peak power.
❒ Query the RF analyser expected input.
❒ Compare measured and expected power, loop to trigger DSP measurement if they are
more than 1dB different. Loop a maximum of three times.
❒ Print the ARFCN, TX Level, Peak and Rms. Phase Error and Frequency Error.
❒ Repeat for the next ARFCN.
❒ Repeat for the next TX Level.
❒ Return to the Cell Control screen.
❒ End call as in exercise A.
Tips:
Placing the TX Level changing loop outside the ARFCN changing loop has several
benefits. The process of changing ARFCN is faster, so the program will run more quickly.
The delay associated with the first ARFCN change will go in parallel with the time taken
for the mobile to respond to the SACCH and change TX Level. This increases the
probability of the mobile being settled on the new TX Level when the DSP measurement
is performed, reducing the number of times it will need to be repeated to get a TX peak
power value close to the expected value. Look at the ‘PERFORM DSP
MEASUREMENTS’ section of example program 1 for more help.
2-8
GPIB Tutorial and Examples
Example C - Making Measurements
Receiver Sensitivity Test
Bit Error Ratio (BER) is the primary measure of GSM receiver sensitivity. For a handheld mobile, the residual type II BER should be less than 2.4% at -102dBm. For most
mobile testing, the downlink power will be maintained at a relatively high level of around
-80dBm. This level is dropped to -102dBm to perform the BER test, then increased again
to -80dBm once the test is complete. When the mobile’s receiver input level drops from
-80 to -102dBm, its receiver AGC compensates by increasing gain. The AGC time
constant varies from mobile to mobile. It can take several seconds for the receiver to
adjust to the new power level and be ready for BER testing. If the level change is large
and followed by a channel assignment, the mobile will often drop the call because its
receiver is not able to decode the FACCH while adjusting to the reduced input power.
Select GPIB commands from "GPIB Commands Used in Exercises" to extend your
program as follows:
❒ Select single trigger mode for DSP measurements
❒ Select single trigger mode for BER measurements
❒ Establish call as in exercise A
❒ Perform TX peak power test on channels 1, 63, 124, levels 5 to 15 with code from
exercise B and C
❒ Perform DSP measurements with code from exercise C
❒ Display the bit error test screen
❒ Reduce the RF Generator power to -102dBm
❒ Wait 2 seconds for the mobile’s AGC to settle
❒ Set up a loop to count through three ARFCN: 1, 63, 124
❒ Command the phone to the new ARFCN
❒ Trigger a BER measurement
❒ Query the BER
❒ Repeat for the next ARFCN
❒ Increase the RF Generator power to -80dBm
❒ Return to the Cell Control screen
❒ End call as in exercise A
2-9
GPIB Tutorial and Examples
Example C - Making Measurements
Tips:
Experiment with shorter AGC settling times, notice the reported BER increase. Try
increasing the RF Generator power to -40dBm at the start of the program and removing
the wait statement. Does the phone drop the call? The required delay depends on the
mobile and the size of the level change. Look at the mobile’s SACCH reports of RXQual
and RXLev. Consider modifying your program to use these reports to decide when the
mobile’s AGC has settled. Look at the “PERFORM BIT ERROR MEASUREMENTS”
section of example program 1 for more help.
2-10
GPIB Tutorial and Examples
Example D - Adding Robustness
Example D - Adding Robustness
There are several additions which can be made to your program to increase its robustness:
❒ Check input power falls within +/-3dB specified analyser range
❒ Check DSP measurement status
❒ Check for Agilent 8922M/S error logs
❒ Provide a time-out for any measurements which do not complete
These checks add little value to a program designed to test phones which are known to
meet specification. In many cases the mobile being tested will be out of specification, the
phone may fail toproduce a burst at thecorrect power and frequency forthe DSP analyser.
If the measurement has been triggered, and no input signal is provided, an GPIB time-out
offers a convenient method for dissarming the DSP trigger and continuing the program. If
the mobile’s TX power falls outside +/-3dB of the expected value, measurement results
may not be valid. If the DSP analyser has not been able to find a good signal, or
synchronise to the burst midamble, the status message will warn of the problem. Dropped
calls and other problems are logged by the Agilent 8922M/S in an error message stack.
The messages can be queried to provide an indication of where problems have occurred
during test execution.
Read through example program 1 and look at the way the GPIB commands in "GPIB
Commands Used in Exercises" have been used to add robustness. Look for the “ERROR
AND TIMEOUT HANDLING” part of the program and the sections making DSP
measurements.
2-11
GPIB Tutorial and Examples
Example E - Faster Testing
Example E - Faster Testing
Load and run example program 1, thenprogram 2, thenprogram 3, or look at the test times
tabulated in section 4 for the Agilent 8922M. The three programs are configured to
perform an identical list of tests, yet their test times are different. This is achieved using
various techniques.
Example program 1 does use some techniques to improve speed:
❒ The complete set of DSP measurements are performed in parallel.
❒ TX peak power measurements are made in parallel with DSP measurements.
❒ Additional TX peak power measurements are made using the Fast TX Carrier Power
measurement. Points covered during the DSP test are not repeated.
❒ Loops are chosen to minimise the number of mobile TX level changes.
❒ No fixed delays are used.
❒ RXQual, RXLev and TX Timing error are checked in parallel with bit error ratio.
❒ Results are printed after testing is complete.
Example program 2 adds some additional time saving techniques:
❒ A hopped call is used for TX measurements to reduce channel changing time.
❒ Measured power is usedto determine when the mobileTX Level has settled ratherthan
waiting for uplink SACCH report.
2-12
GPIB Tutorial and Examples
Example E - Faster Testing
Example program 3 uses the Agilent 8922M/S Aux RF Out port to simulate a mobile
operating in a test mode. Mobiles controlled in test modes react much faster to channel
and TX Level change commands.
❒ Delays associated with the GSM SACCH and FACCH are removed.
❒ Measurements are made with no signalling overhead time.
The time savings made in programs 2 and 3 have been almost completely during the TX
part of the test. Improving the RX bit error ratio test time would speed-up each of the
programs. As TX test times reduce, RX tests appear to take up a larger percentage of the
overall test time. Techniques for improving RX measurement times include:
❒ Take RXQual as a first indication of receiver performance. Perform bit error test only
if RX Qual is poor.
❒ Reduce the number of bits being tested and reduce the signal level from -102dBm to a
lower level. This will increase the number of bit errors in the reduced measurement
period to maintain a statistically valid test.
❒ Look for zero bit errors at -102dBm over a reduced number of bits. Use a longer
measurement only if bit errors are detected.
2-13
GPIB Tutorial and Examples
GPIB Commands Used in Exercises
GPIB Commands Used in Exercises
Commands used in exercise A:
Preset the instrument
OUTPUT Uut;”*RST”
Set the paging IMSI
OUTPUT Uut;”MSINFO:PAGING:IMSI ‘001012345678901’”
Enter an external cable loss offset of 1dB
OUTPUT Uut;”CONF:OFL:RFIN “;-1
Set external loss offset mode on
OUTPUT Uut;”CONF:OFL:MODE ‘ON’”
Zero the power meter
OUTPUT Uut;”CW:PMZERO”
Page the mobile
OUTPUT Uut;”CELL:CALL:ORIGINATE”
Query the call status
OUTPUT Uut;”CELL:CALL:STATUS:STATE?”
ENTER Uut;Status$
End the call
OUTPUT Uut;”CELL:CALL:END”
Commands used in exercise B:
Program the mobile TX Level
OUTPUT Uut;”CELL:MS:TLEV”;Txlevel
Query the mobile’s reported TX Lev
OUTPUT Uut;”MEAS:CELL:SACCH:TLEV?”
ENTER Uut;Sacchtxlev
Prgram the mobile’s Traffic Channel ARFCN
OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn
Query the reported ARFCN
OUTPUT Uut;”CELL:CALL:STAT:TCH:ARFCN?”
ENTER Uut;Faccharfcn
2-14
GPIB Tutorial and Examples
GPIB Commands Used in Exercises
Commands used in exercise C:
Query Fast TX Carrier Power (TX Peak Power)
OUTPUT Uut;”MEAS:FTCP:POW?”
ENTER Uut;Txpkpwr
Query RF Analyzer Expected Input Amplitude
OUTPUT Uut;”RFAN:AMPL1?”
ENTER Uut;Exppwr
Set the DSP Analyzer to single trigger mode
OUTPUT Uut;”TRIG:MODE ‘SINGLE’”
Display the DSP Analyzer (default sub-screen is phase and frequency error)
OUTPUT Uut;”DISP DSP”
Trigger a DSP measurement
OUTPUT Uut;”TRIG:AST ‘ARM’”
Querry the rms phase error
OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:RMS?”
ENTER Uut;Rmsphase
Query peak phase error
OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:PEAK?”
ENTER Uut;Pkphase
Query frequency error
OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:FREQUENCY?”
ENTER Uut;Freqerr
Query TX peak power
OUTPUT Uut;”MEASURE:DSPANALYZER:PTCP?”
ENTER Uut;Txpkpwer
Display the Cell Control screen
OUTPUT Uut;”DISP CELL1”
Set single trigger mode for bit error measurements
OUTPUT Uut;”TRIG:BET ‘SINGLE’”
Display the bit error test screen
OUTPUT Uut;”DISP:SCR BER1”
Program the RF Generator power
OUTPUT Uut;”RFG:AMPL1 “;Berpower
Trigger a bit error measurement
OUTPUT Uut;”TRIG:BET:MODE ‘RUN’”
2-15
GPIB Tutorial and Examples
Example Programs
Query the completed bit error test result
OUTPUT Uut;”MEAS:BET:BERR:RATIO1?”
ENTER Uut;Berppm
Reset the SACCH reports
OUTPUT Uut;”MEAS:CELL:SACCH:RESET”
Query the RXQual report (-1 returned if no report yet)
OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RQU?”
ENTER Uut;Rxqual
Commands used in exercise D:
OUTPUT Uut;”MEASURE:DSPANALYZER:SSTATUS?”
ENTER Uut;Sstatus$
Check for logged Agilent 8922M/S system errors
OUTPUT Uut;”SYSTEM:ERROR?”
ENTER Uut;Systemerr$
Example Programs
Speed Comparison
Using the Agilent 8922M GSM MS Test Set
Program 1Program 2Program 3
Time for testing85.5 sec.42.7 sec.
Time for call clear down1.1 sec.1.1 sec.1.1 sec.
a.Some time overhead was incurred because the Agilent 8922M was being
used to emulate a mobile in test mode. Reduced test times would be possible if the instrument was only performing measurements.
64.6 sec.
a
2-16
GPIB Tutorial and Examples
Example Programs
Test List
Tx Tests
ARFCNTx Levels
Tx Power1, 65, 1245, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15
Peak and rms phase error1, 65, 1245, 10, 15
Frequency error1, 65, 1245, 10, 15
Power versus time1, 65, 1245, 10, 15
Rx Tests
ARFCNDownlink Power
Residual Type II BER 10,000
a
bits
Rx Qual Rx Lev1, 65, 124-102 dBm
MS Timing1, 65, 124-102 dBm
a.Up to four BER measurements can be performed in parallel with no added test
time.
Time for phone to camp and answer page: 11.21 Seconds.
Time for testing : 46.52 Seconds.
Time for call clear down : 2.05 Seconds.
No Errors
Would you like to test again? (y or n)
2-18
GPIB Tutorial and Examples
Program 1
Program 1
10 !RE-STORE “PROG1”
20 !RE-SAVE “PROG1:,1404”
30 !===========================================================================
40 !
50 !Example program 1
60 !
70 !Introductory GPIB techniques for measuring a GSM900 mobile using the
Agilent 8922S and M
80!GSM MS Test Sets. The program measures Tx power, power vs time, phase and frequency
90 !error, bit error ratio, timing error, Rx Lev and Rx Qual
100 !
110 !(c) Agilent Technologies 1996
120 !
130 !Rev 1.0
140 !I R HP QMD 7.9.94
150 !Slightly modified by C B 24.1.96 - Changed F/H to M/S throughout
160
!=================================================================================
170 !
180 DIM Berpwr(5) !Downlink power levels in dBm for bit error test
190 DIM Berarfcn(125) !ARFCN to perform bit error test on
200 DIM Dsppwr(15) !Mobile Tx power levels for DSP test
210 DIM Dsparfcn(124) !ARFCN to perform DSP test on
220 DIM Fparfcn(124) !ARFCN to perform fast power test on
230 DIM Fppwr(15) !Mobile Tx power levels for fast power test
240 DIM Message$(30)[100] !Output strings
250 DIM Error$(50)[100] !Error message strings
260 DIM Err$[100] !Internally used temporary error string
270 DIM Rmspher(50,50) !Measurement results from rms phase error, dimensions(ARFCN,TXLEVEL)
280 DIM Pkpher(50,50) !Measurement results from peak phase error
290 DIM Frer(50,50) !Measurement results from freq error
300DIM Slpwr(50,50)!Measurement results from DSP analyzer power measurement
310 DIM Txtim(50,50) !Tx timing error measurement results
320 DIM Fpwrmeas(50,50) !Measurement results from fast power
330 DIM Ber1(50,50) !Bit error test measurement results, dimensions(ARFCN,Downlink Power)
340 DIM Clock(5) !Test Times
350 DIM Mask$(50,50)[10] !Power versus time limit mask specification
360 DIM Rxqual(50,50) !RxQual measurement results, dimensions(ARFCN,Downlink Power)
370 DIM Rxlev(50,50) !RxLev measurement results
380 DIM Null(50,50) !Empty array
390 DIM Nullst$(50,50)[50] !Empty string array
400 !
410 !=======================================================
420 !
430 !GENERAL MEASUREMENT SET UP SPECIFIED
440 !
450 Uut=714 GPIB address of Agilent 8922M/S
460 Extloss=-1 !Loss of cable linking 8922 to mobile (loss=-xdB)
470 Bchpwr=-80 !BCCH power level in dBm
480 Imsi$=”’001012345678901’” !Paging IMSI of mobile’s test SIM
490 Timeouttime=20 !The GPIB timeout in seconds
500Leveltol=1!Level threshold to indicate Tx Lev settling for DSP
measurement
510 !
520 !================================================================================
530 !
540 !MEASUREMENT POINTS ARE DEFINED IN THIS SECTION
2-19
GPIB Tutorial and Examples
Program 1
550 !
560 !Bit error ratio test
570 !
580 Numberpwr=1 !The number of downlink power levels for bit error
test
590Berpwr(1)=-102!The power level in dBm of the first downlink power.
Etc....
600Bits1=10000!The number of bits to test at each ARFCN/Power combination
610 Numberarfcn=3 !The number of ARFCN for bit error test
620 Berarfcn(1)=1 !The value of the first ARFCN. Etc....
630 Berarfcn(2)=65
640 Berarfcn(3)=124
650 !
660 !DSP measurememnts
670 !
680 Numdsppwr=3 !The number of mobile TX Levels for DSP test
690 Dsppwr(1)=5 !The value of the first TX Level. Etc...
700 Dsppwr(2)=10
710 Dsppwr(3)=15
720 Numdsparfcn=3 !The number of ARFCN for DSP test
730 Dsparfcn(1)=1 !The value of the first ARFCN. Etc....
740 Dsparfcn(2)=65
750 Dsparfcn(3)=124
760 !
770 !Fast Power measurements
780 !
790 Numfppwr=8 !The number of mobile TX Levels for fast power test
800 Fppwr(1)=6 !The value of the first TX Level. Etc....
810 Fppwr(2)=7
820 Fppwr(3)=8
830 Fppwr(4)=9
840 Fppwr(5)=11
850 Fppwr(6)=12
860 Fppwr(7)=13
870 Fppwr(8)=14
880 Numfparfcn=3 !The number of ARFCN for fast power test
890 Fparfcn(1)=1 !The value of the first ARFCN. Etc...
900 Fparfcn(2)=65
910 Fparfcn(3)=124
920 !
930 !===========================================================================
940 !
950 !PRINT MESSAGES ARE DEFINED BELOW
960 !
970 Message$(1)=”Answer call when mobile rings”
980 Message$(2)=”Would you like to test again? (y or n)”
990 Message$(3)=”Results from Fast Power Measurement”
1000 Message$(4)=”ARFCN TXLEV POWER dBm”
1010 Message$(5)=”Results from Power, Power vs Time & Modulation Measurements”
1020 Message$(6)=”ARFCN TXLEV POWER dBm Pk & RMS PHASE FREQ ERROR MASK”
1030 Message$(7)=”Results from BER Test”
1040 Message$(8)=”ARFCN Downlink dBm BER1% RxQual RxLev TIMERR”
1050 Message$(9)=” Seconds.”
1060 Message$(10)=”Time for phone to camp and answer page: “
1070 Message$(11)=”Time for testing : “
1080 Message$(12)=”Time for call clear down : “
1090 !
1100 Emptyst$=”@”
1110 Empty=-999
1120 Nullst$(1,1)=Emptyst$
1130 Null(1,1)=Empty
1140 !
1150
!====================================================================================
1160 !
1170 !ERROR AND TIMEOUT HANDLING
1180 !
2-20
GPIB Tutorial and Examples
Program 1
1190 Busport=INT(Uut/100)!Get the GPIB port code from Uut
address
1200 CLEAR Busport!Clear bus from any aborted previous
commands
1210 Timeinit$=”yes”!Set a flag so timeout code is not
executed first pass
1220 ON TIMEOUT Busport,Timeouttime GOTO Timeflag!Establish goto flag
for HPIB timeouts
1230 Timeflag:IF Timeinit$<>”yes” THEN!After a timeout, execution comes
here
1240 OFF TIMEOUT Busport
1250 CLEAR Busport !Clear any half done commands
1260 OUTPUT Uut;”TRIG:AST ‘disarm’” !Dissarm the DSP trigger
1270CALL Sub_syserror(Uut,Error$(*),Errcount)!Gather any error message from the
Agilent 8922M/S
1280 PRINT “Measurement Timed Out. Ending Test”
1290 IF Errcount=0 THEN
1300 Errcount=1
1310 Error$(1)=”No errors recorded”
1320 END IF
1330 FOR X=1 TO Errcount !Print error messages
1340 PRINT Error$(X)
1350 NEXT X
1360STOP!Execution stops here after critical
errors
1370 ELSE
1380Timeinit$=”no”!Reset flag so next time, it must
be a real timeout
1390 END IF
1400 Errcount=0
1410 CALL Sub_syserror(Uut,Error$(*),Errcount) !Clear any old errors from
Agilent 8922M/S before the
1420 Errcount=0 !test begins
1430 !
1440
!=================================================================================
1450 !
1460 !PRESET THE Agilent 8922M/S AND SET IT TO THE CORRECT COMPATIBILITY MODE (executed once only)
1470 !
1480 !
1490 OUTPUT Uut;”*RST” !Preset the Agilent 8922M/S
1500 OUTPUT Uut;”CONF:COMP?”!Check compatability mode and set
to F or H
1510 ENTER Uut;Product$
1520 IF Product$<>”””8922S””” AND Product$<>”””8922M””” THEN
1530 IF Product$=”””8922E””” THEN OUTPUT Uut;”CONF:COMP ‘8922S’”
1540 IF Product$=”””8922G””” THEN OUTPUT Uut;”CONF:COMP ‘8922M’”
1550OUTPUT Uut;”*RST”!A preset is needed after compatability change
1560 END IF
1570 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any errors logged by
HP 8922M/S
1580 !
1590 !===========================================================================
1600 !
1610 !SET THE Agilent 8922M/S INITIAL CONDITIONS (executed once only)
1620 !
1630 !
1640 OUTPUT Uut;”MSINFO:PAGING:IMSI “&Imsi$ !Set the paging IMSI
1650 OUTPUT Uut;”CONF:OFL:RFIN “;Extloss !Set the external cable loss
1660 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Dsparfcn(1) !Set the ARFCN to the first
expected test point
1670 OUTPUT Uut;”CELL:MS:TLEV “;Dsppwr(1) !Set the mobile Tx Level to the
first test point
1680 OUTPUT Uut;”CONF:OFL:MODE ‘ON’”!Turn external offset mode ON to
use cable loss
1690 OUTPUT Uut;”CW:PMZERO” !Zero the power meter
2-21
GPIB Tutorial and Examples
Program 1
1700 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr!Set the downlink power for normal
signalling
1710 OUTPUT Uut;”TRIG:MODE ‘SINGLE’”!Set the DSP meas trigger to single
trig mode
1720 OUTPUT Uut;”TRIG:BET ‘SINGLE’”!Set bit error meas trigger to single trig mode
1730 OUTPUT Uut;”BET:BITS1 “;Bits1!Set the number of bits to be measured for bit error
1740 OUTPUT Uut;”DISP:SCR DSP” !Display the DSP amplitude main
screen to enter limits
1750 OUTPUT Uut;”DISP:SCR:DSP:VIEW ‘AMPL MAIN’” !for power versus time mask
1760 DATA -40,-28,-18,-10,0,180,360,542.769,547.769,552.769,560.769,570.769 !Mask
corner times in us
1770 DATA -36,-30,-6,4,1,1,1,1,1,-6,-30,-36 !Upper
limits in dB
1780 DATA -60,-60,-60,-60,-1,-1,-1,-1,-60,-60,-60,-60!Lower limits in dB
1790 FOR X=1 TO 12
1800 READ Masktim !Reas corner times
from DATA statement
1810 Masktim=Masktim/1.E+6 !Convert seconds
1820 Num$=VAL$(X) !Convert index to
string for GPIB
1830OUTPUT Uut;”DSP:AMPL:”&”time”&Num$&” “;Masktim!Output marker times
1840 NEXT X
1850 FOR X=1 TO 12
1860READ Maskup!Read and output upper
limits
1870 Num$=VAL$(X)
1880 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM “;Maskup
1890 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM:STATE ON”
1900 NEXT X
1910 FOR X=1 TO 12
1920READ Masklo!Read and output lower
limits
1930 Num$=VAL$(X)
1940 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM “;Masklo
1950 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM:STATE ON”
1960 NEXT X
1970 !
1980
!===============================================================================
1990 !
2000 !ESTABLISH A LOOP TO BE EXECUTED EACH TIME A MOBILE IS TESTED
2010 !
2020 !
2030 Run$=”yes”!Flag for REPEAT loop
2040 REPEAT
2050 Clock(1)=TIMEDATE !Start a test time
clock for call set up
2060 !
2070 !=============================================================================
2080 !
2090 !PAGE THE MOBILE AND ESTABLISH A CALL
2100 !
2110 !
2120 OUTPUT Uut;”DISP:SCR CELL1” !Display the cell
control screen
2130PRINT Message$(1)!Output answer call
message
2140 OUTPUT Uut;”CELL:CALL:ORIGINATE” !Page mobile
Agilent 8922M/S org call
2150Time=0!Set counter for mobile
to answer
2160 Maxtime=100
2170 REPEAT
2180 Time=Time+1
2190 WAIT 1
2-22
GPIB Tutorial and Examples
Program 1
2200OUTPUT Uut;”CELL:CALL:STATUS:STATE?”!Check the call status
for connected
2210 ENTER Uut;Status$
2220 UNTIL Status$=”””CONNECTED””” OR Time>Maxtime
2230 IF Time>Maxtime THEN
2240 Errcount=Errcount+1
2250 Error$(Errcount)=”Call could not be established”
2260 GOTO Timeflag !If wait too long,
goto timeout code
2270 END IF
2280CALL Sub_syserror(Uut,Error$(*),Errcount)!Check for any errors
logged
2290 !
2300
!====================================================================================
2310 !
2320Clock(1)=TIMEDATE-Clock(1)!End call set up timer
2330Clock(2)=TIMEDATE!Start measurement timer
2340 !
2350
!====================================================================================
=
2360 !
2370 !PERFORM DSP MEASUREMENTS
2380 !
2390 OUTPUT Uut;”DISP DSP” !Return to the DSP
amplitude main screen
2400 FOR Txcount=1 TO Numdsppwr !Outer loop for Tx
levels
2410Txlev=Dsppwr(Txcount)!Get Tx level from array
2420OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Program mobile’s Tx
level
2430FOR Arcount=1 TO Numdsparfcn!Inner loop for ARFCN
2440Arfcn=Dsparfcn(Arcount)!Get ARFCN from array
2450 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn !Program link ARFCN
2460 Count=0 !Establish counter
for repeat measurements
2470REPEAT!May need to repeat
if mobile not settled
2480OUTPUT Uut;”TRIG:AST ‘ARM’”!Arm the DSP measurement
2490 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:RMS?” !Read all the DSP
results: rms phase error
2500 ENTER Uut;Rmspher(Arcount,Txcount)
2510 !Note: program will stick here, waiting for input if mobile fails to provide a
valid signal to trigger
2520 !the Agilent 8922M/S. The program will timeout. The timeout code dissarms
the Agilent 8922M/S trigger.
2530OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:PEAK?” !
peak phase error
2540 ENTER Uut;Pkpher(Arcount,Txcount)
2550 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:FREQUENCY?”! frequency error
2560 ENTER Uut;Frer(Arcount,Txcount)
2570OUTPUT Uut;”MEASURE:DSPANALYZER:MSUM?”!
power versus time mask
2580 ENTER Uut;Mask$(Arcount,Txcount)
2590OUTPUT Uut;”MEASURE:DSPANALYZER:PTCP?”!
Tx power
2600 ENTER Uut;Slpwr(Arcount,Txcount)
2610OUTPUT Uut;”RFAN:AMPL1?”!Read expected power
level to compare with
2620ENTER Uut;Anlevel!measured and +/-3dB
allowed range
2630 OUTPUT Uut;”MEASURE:DSPANALYZER:SSTATUS?” !Check for any DSP
measurement errors
2640 ENTER Uut;Sstatus$
2-23
GPIB Tutorial and Examples
Program 1
2650Threedb=ABS(Anlevel-Slpwr(Arcount,Txcount))!Calculate difference
between measured and expected
2660 Count=Count+1
2670 UNTIL Count=3 OR Threedb<Leveltol !Re-do DSP once if
phone fails, the mobile
2680IF Sstatus$<>”””No Error””” OR Threedb>3 THEN!may still be settling
after Tx Level change
2690Err$=”DSP Measurement Problem “!Create an error message string
2700 IF Sstatus$<>”””No Error””” THEN Err$=Err$&Sstatus$
2710 IF Threedb>3 THEN Err$=Err$&” 3dB input range exceeded”
2720 Errcount=Errcount+1
2730 Error$(Errcount)=Err$
2740 END IF
2750 NEXT Arcount
2760 NEXT Txcount
2770 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for logged
errors after DSP
2780 !
2790
!====================================================================================
2800 !
2810 !PERFORM FAST POWER MEASUREMENTS
2820 !
2830OUTPUT Uut;”DISP:SCR CELL1”!Display cell control
screen
2840FOR Txcount=1 TO Numfppwr!Outer loop for mobile
Tx levels
2850Txlev=Fppwr(Txcount)!Get Tx level from array
2860OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Program mobile’s Tx
level
2870Time=0!Establish a loop to
wait for phone to
2880Maxtime=10!confirm over uplink
SACCH that it has
2890REPEAT!reached commanded Tx
level
2900OUTPUT Uut;”MEAS:CELL:SACCH:TLEV?”!Read mobile’s SACCH
report of Tx Level
2910 ENTER Uut;Sacchtxlev
2920WAIT .4!Pause, SACCH has low
banswidth so reports
2930 Time=Time+1 !update slowly
2940 UNTIL Sacchtxlev=Txlev OR Time=Maxtime !Check for mobile
reaching programmed Tx level
2950 IF Time=Maxtime THEN
2960 Errcount=Errcount+1
2970 Error$(Errcount)=”Mobile failed to change Tx Level” !Error if mobile
doesn’t reach programmed level
2980 END IF
2990FOR Arcount=1 TO Numfparfcn!Inner loop for measurement ARFCN
3000Arfcn=Fparfcn(Arcount)!Get ARFCN from array
3010OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn!Request TCH channel
assignement to new ARFCN
3020Time=0!Establish a loop to
wait for channel
3030Maxtime=10!assignment to complete
3040 REPEAT
3050 OUTPUT Uut;”CELL:CALL:STAT:TCH:ARFCN?” !Check call status
for HP 8922M/S to see if
3060ENTER Uut;Reparfcn!mobile has reached
new channel
3070WAIT .1!Short pause. Channel
changes use FACCH which
3080Time=Time+1!is faster than SACCH
for Tx level changes
2-24
GPIB Tutorial and Examples
Program 1
3090 UNTIL Reparfcn=Arfcn OR Time=Maxtime !If reported ARFCN
matches programmed ARFCN
3100IF Time=Maxtime THEN!FACCH handshake is
complete and mobile is on
3110 Errcount=Errcount+1 !new channel.
3120Error$(Errcount)=”Mobile failed channel assignment” !If mobile fails to
reach new channel, set an error
3130END IF!Now mobile is stable
on new Tx level and ARFCN
3140OUTPUT Uut;”MEAS:FTCP:POW?”!read the peak power
meter
3150 ENTER Uut;Fpwrmeas(Arcount,Txcount)
3160 OUTPUT Uut;”RFAN:AMPL1?” !Read the
Agilent 8922M/S analyzer expected input level
3170ENTER Uut;Anlevel!and compare with the
measured power to check that
3180Threedb=ABS(Anlevel-Fpwrmeas(Arcount,Txcount))!the result is within
the allowed +/-3dB window
3190 IF Threedb>3 THEN
3200 Errcount=Errcount+1
3210 Error$(Errcount)=”Fast power meas 3dB input range exceeded”
3220 END IF
3230 NEXT Arcount
3240 NEXT Txcount
3250CALL Sub_syserror(Uut,Error$(*),Errcount)!Check Agilent 8922M/
S error log
3260 !
3270!================================================================================
====
3280 !
3290 !PERFORM BIT ERROR MEASUREMENTS
3300 !
3310OUTPUT Uut;”DISP:SCR BER1”!Display single BER
test screen
3320FOR Rxcount=1 TO Numberpwr!Outer loop for downlink power levels
3330Berpo=Berpwr(Rxcount)!Get downlink power
level from array
3340OUTPUT Uut;”RFG:AMPL1 “;Berpo!Program Agilent 8922M/
S Generator to downlink power
3350Count=0!Establish a loop to
wait for the mobile’s receiver
3360Instance=0!AGC to recover from
downlink level change.
3370REPEAT!The mobile’s reported
RXQual will indicate when
3380 OUTPUT Uut;”MEAS:CELL:SACCH:RESET” !the AGC has recovered. Start by clearing old SACCH
3390Count=Count+1!The inner REPEAT loop
is used to check and wait
3400Rxqualsettle=-1!for the next SACCH
report from mobile. When the
3410Time=0!Agilent 8922M/S is
waiting for a report, after a SACCH
3420REPEAT!reset it returns -1
3430 WAIT .3 !Pause. SACCH is a
low bandwidth channel.
3440 Time=Time+1
3450OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RQU?”!Read the SACCH report
from the mobile
3460 ENTER Uut;Rxqualsettle !-1 is returned if
Agilent 8922M/S is still waiting
3470 UNTIL Time>7 OR Rxqualsettle<>-1 !for the report
3480 IF Rxqualsettle<=4 THEN !If RxQual is less
than 4, it’s good enough to
3490Instance=Instance+1!continue. The program
checks for more than
2-25
GPIB Tutorial and Examples
Program 1
3500ELSE!3 consecutive reports
at RxQual 4 or less to
3510Instance=0!be be sure the mobile
has stabalized. The
3520END IF!mobile may return up
to 2 reports at the old
3530 UNTIL Count>20 OR Instance>3 !level, before it
recognizes the input level
3540 IF Count>20 OR Rxqualsettle=-1 THEN !change
3550Errcount=Errcount+1!If RxQual does not
stabalize, report an error
3560 Error$(Errcount)=”Mobile receiver AGC did not respond to downlink level
change”
3570 END IF
3580FOR Arcount=1 TO Numberarfcn!Inner loop for BER
test ARFCN
3590Arfcn=Berarfcn(Arcount)!Get ARFCN from array
3600 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn !Request channel
assignment. Agilent 8922M/S will hold
3610OUTPUT Uut;”TRIG:BET:MODE ‘RUN’”!off BER test until
channel change is done. Run test.
3620 OUTPUT Uut;”MEAS:CELL:SACCH:RESET” !While BER test is
running, test SACCH reports
3630 Rxlev(Arcount,Rxcount)=-1 !Clear old reports
3640 Time=0
3650 REPEAT !Loop and wait for
SACCH report. -1 is returned
3660WAIT .3!when Agilent 8922M/
S is waiting for report
3670 Time=Time+1
3680 OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RLEV?” !Read RxLev
3690 ENTER Uut;Rxlev(Arcount,Rxcount)
3700 OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RQU?” !Read RxQual
3710 ENTER Uut;Rxqual(Arcount,Rxcount)
3720 OUTPUT Uut;”MEAS:CELL:MS:TERR?” !Also read uplink
timing error
3730 ENTER Uut;Txtim(Arcount,Rxcount)
3740UNTIL Time>7 OR Rxlev(Arcount,Rxcount)<>-1!Try again if SACCH
report not ready
3750OUTPUT Uut;”MEAS:BET:BERR:RATIO1?”!Read bit error test
result
3760 ENTER Uut;Ber1(Arcount,Rxcount)
3770Ber1(Arcount,Rxcount)=Ber1(Arcount,Rxcount)/10000!Convert from ppm to
%
3780 NEXT Arcount
3790 NEXT Rxcount
3800 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr !Reset downlink to
normal power
3810CALL Sub_syserror(Uut,Error$(*),Errcount)!Check for any logged
errors
3820 !
3830 !=========================================================================
3840 !
3850Clock(2)=TIMEDATE-Clock(2)!Stop measurement timer
3860Clock(3)=TIMEDATE!Start call clearing
timer
3870 !
3880
!================================================================================
3890 !
3900 !END THE CALL
3910 !
3920 OUTPUT Uut;”DISP CELL1” !Display the cell
control screen
3930OUTPUT Uut;”CELL:CALL:END”!Request a call termination
3940Time=0!Establish a loop to
wait for the mobile
2-26
GPIB Tutorial and Examples
Program 1
3950 REPEAT !to clear the call
3960 Time=Time+1
3970 WAIT 1
3980OUTPUT Uut;”CELL:CALL:STATUS:STATE?”!Check the call status
3990 ENTER Uut;Status$
4000UNTIL Status$=”””INACTIVE””” OR Time>30!Call status will go
to inactive when the
4010 IF Time>30 THEN !mobile has cleared
4020 Errcount=Errcount+1
4030Error$(Errcount)=”Mobile failed to end call”!Log an error if the
mobile fails to clear
4040GOTO Timeflag!and go to the timeout
code
4050 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any
Agilent 8922M/S logged errors
4060 END IF
4070OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Dsparfcn(1)!Reset the ARFCN and
mobile Tx level ready
4080OUTPUT Uut;”CELL:MS:TLEV “;Dsppwr(1)!to begin testing the
next phone
4090
!===================================================================================
4100 !
4110Clock(3)=TIMEDATE-Clock(3)!Stop the call clearing
timer
4120 !
4130
!====================================================================================
4140 !
4150 !PRINT MEASUREMENT RESULTS
4160 !
4170 CALL
Sub_printit(Fparfcn(*),Fppwr(*),Fpwrmeas(*),Null(*),Null(*),Null(*),Null(*),Nullst$(*
),Numfparfcn,Numfppwr,Message$(3),Message$(4),Emptyst$,Empty)
4180 CALL
Sub_printit(Dsparfcn(*),Dsppwr(*),Slpwr(*),Pkpher(*),Rmspher(*),Frer(*),Null(*),Mask$
(*),Numdsparfcn,Numdsppwr,Message$(5),Message$(6),Emptyst$,Empty)
4190 CALL
Sub_printit(Berarfcn(*),Berpwr(*),Ber1(*),Rxqual(*),Rxlev(*),Txtim(*),Null(*),Nullst$
(*),Numberarfcn,Numberpwr,Message$(7),Message$(8),Emptyst$,Empty)
4200 !
4210
!====================================================================================
4220 !
4230 !PRINT TEST TIMES AND ERROR MESSAGES
4240 !
4250 !
4260 FOR X=1 TO 3
4270 PRINT Message$(X+9);DROUND(Clock(X),4);Message$(9)
4280 NEXT X
4290 PRINT
4300 PRINT
4310 IF Errcount=0 THEN
4320 Errcount=1
4330 Error$(1)=”No Errors”
4340 END IF
4350 FOR X=1 TO Errcount
4360 PRINT Error$(X)
4370 NEXT X
4380 Errcount=0
4390 !
4400
!=================================================================================
4410 !
4420 !LOOP IF ANOTHER PHONE IS TO BE TESTED
4430 !
4440 PRINT Message$(2)
4450 INPUT Answer$
2-27
GPIB Tutorial and Examples
Program 1
4460 Run$=”no”
4470 IF Answer$=”Y” OR Answer$=”y” THEN Run$=”yes”
4480 UNTIL Run$<>”yes”
4490 END
4500 !
4510
!====================================================================================
4520 !SUBROUTINES BELOW
4530
!====================================================================================
4540 !
4550 !RESULTS PRINTING SUBROUTINE
4560 !
4570 SUB
Sub_printit(Result1(*),Result2(*),Result3(*),Result4(*),Result5(*),Result6(*),Result7
(*),Result8$(*),Numarfcn,Numpwr,Title$,Heading$,Emptyst$,Empty)
4580 PRINT Title$
4590 PRINT
4600 PRINT Heading$
4610 FOR Arcount=1 TO Numarfcn
4620 FOR Txcount=1 TO Numpwr
4630 PRINT Result1(Arcount),
4640 PRINT Result2(Txcount),
4650 IF Result3(1,1)<>Empty THEN PRINT DROUND(Result3(Arcount,Txcount),4),
4660 IF Result4(1,1)<>Empty THEN PRINT DROUND(Result4(Arcount,Txcount),4),
4670 IF Result5(1,1)<>Empty THEN PRINT DROUND(Result5(Arcount,Txcount),4),
4680 IF Result6(1,1)<>Empty THEN PRINT DROUND(Result6(Arcount,Txcount),4),
4690 IF Result7(1,1)<>Empty THEN PRINT DROUND(Result7(Arcount,Txcount),4),
4700 IF Result8$(1,1)<>Emptyst$ THEN PRINT Result8$(Arcount,Txcount),
4710 PRINT
4720 NEXT Txcount
4730 NEXT Arcount
4740 PRINT
4750 SUBEND
4760 !
4770 !=============================================================================
4780 !
4790 !CHECK FOR Agilent 8922M/S SYSTEM ERRORS
4800 !
4810 SUB Sub_syserror(Uut,Error$(*),Errcount)
4820 DIM Systemerror$[100]
4830 REPEAT !Set up a loop to drain the
Agilent 8922M/S error stack
4840OUTPUT Uut;”SYSTEM:ERROR?”!Read the last error from the
stack
4850 ENTER Uut;Systemerror$
4860 IF VAL(Systemerror$)<>0 THEN !Code 0 indicates no error
4870Errcount=Errcount+1!If not zero, add the error to
the programs error array
4880 Error$(Errcount)=Systemerror$
4890 END IF
4900UNTIL VAL(Systemerror$)=0!End when all the errors have
been read
4910 SUBEND
4920 !
4930 !==============================================================================
4940 !end of program
2-28
GPIB Tutorial and Examples
Program 2
Program 2
10 !RE-STORE “PROG2”
20 !RE-SAVE “PROG2:,1404”
30 !=========================================================================
40 !
50 !Example program 2
60 !
70!Advanced GPIB techniques for measuring a GSM900 mobile using the Agilent 8922S
and M
80!GSM MS Test Sets. The program measures Tx power, power vs time, phase and frequency
90!error, bit error ratio, timing error, Rx Lev and Rx Qual. A hopping TCH is used
100 !to minimize channel change time. Power measurements are used to indicate when
the mobile
110 !has settled after a Tx Level change
120 !
130 !(c) Agilent Technologies 1996
140 !
150 !Rev 1.0
160 !I R HP QMD 7.9.94
170 !Slightly modified by C B 24.1.96 - Changed F/H to M/S throughout
180 !============================================================================
190 !
200 DIM Berpwr(5) !Downlink power levels in dBm for bit error test
210 DIM Berarfcn(125) !ARFCN to perform bit error test on
220 DIM Dsppwr(15) !Mobile Tx power levels for DSP test
230 DIM Dsparfcn(124) !ARFCN to perform DSP test on
240 DIM Fparfcn(124) !ARFCN to perform fast power test on
250 DIM Fppwr(15) !Mobile Tx power levels for fast power test
260 DIM Message$(30)[100] !Output strings
270 DIM Error$(50)[100] !Error message strings
280 DIM Err$[100] !Internally used temporary error string
290 DIM Rmspher(50,50) !Measurement results from rms phase error, dimensions(ARFCN,TXLEVEL)
300 DIM Pkpher(50,50) !Measurement results from peak phase error
310 DIM Frer(50,50) !Measurement results from freq error
320DIM Slpwr(50,50)!Measurement results from DSP analyzer power measurement
330 DIM Txtim(50,50) !Tx timing error measurement results
340 DIM Fpwrmeas(50,50) !Measurement results from fast power
350 DIM Ber1(50,50) !Bit error test measurement results, dimensions(ARFCN,Downlink Power)
360 DIM Clock(5) !Test Times
370 DIM Mask$(50,50)[10] !Power versus time limit mask specification
380 DIM Rxqual(50,50) !RxQual measurement results, dimensions(ARFCN,Downlink Power)
390 DIM Rxlev(50,50) !RxLev measurement results
400 DIM Null(50,50) !Empty array
410 DIM Nullst$(50,50)[50] !Empty string array
420DIM Ca$[124]!String for CA (Cell Allocation) table, used for hopping call
430 DIM Ma$[63] !String for MA (Mobile Allocation) table, used for
hopping call
440 !
450 !====================================================================
460 !
470 !GENERAL MEASUREMENT SET UP SPECIFIED
480 !
490 Uut=714 !GPIB address of Agilent 8922M/S
500 Extloss=-1 !Loss of cable linking 8922 to mobile (loss=-xdB)
510 Bchpwr=-80 !BCCH power level in dBm
520 Imsi$=”’001012345678901’” !Paging IMSI of mobile’s test SIM
530 Timeouttime=30 !The GPIB timeout in seconds
2-29
GPIB Tutorial and Examples
Program 2
540 Leveltol=1 !Power tolerence to indicate TX Level has settled
after change (dB)
550Fpthreshold=.3!Power tolerence for fast power measurement after analyzer channel change (dB)
560 !
570 !======================================================================
580 !
590 !MEASUREMENT POINTS ARE DEFINED IN THIS SECTION
600 !
610 !Bit error ratio test
620 !
630 Numberpwr=1 !The number of downlink power levels for bit error
test
640Berpwr(1)=-102!The power level in dBm of the first downlink power.
Etc....
650Bits1=10000!The number of bits to test at each ARFCN/Power combination
660 Numberarfcn=3 !The number of ARFCN for bit error test
670 Berarfcn(1)=1 !The value of the first ARFCN. Etc....
680 Berarfcn(2)=65
690 Berarfcn(3)=124
700 !
710 !
720!NOTE: with hopping call method used in this program, no two ARFCN in either DSP
or Fast Power
730 ! should be placed too close together. Closely spaced ARFCN will allow
unwanted energy to
740!to fall within the Agilent 8922M/S IF bandwidth and RF rise trigger on the
wrong timeslot.
750 ! Expect DSP FM Errors if this happens.
760 !
770 !DSP measurememnts
780 !
790 Numdsppwr=3 !The number of mobile TX Levels for DSP test
800 Dsppwr(1)=5 !The value of the first TX Level. Etc...
810 Dsppwr(2)=10
820 Dsppwr(3)=15
830 Numdsparfcn=3 !The number of ARFCN for DSP test
840 Dsparfcn(1)=1 !The value of the first ARFCN. Etc....
850 Dsparfcn(2)=65
860 Dsparfcn(3)=124
870 !
880 !Fast Power measurements
890 !
900 Numfppwr=8 !The number of mobile TX Levels for fast power test
910 Fppwr(1)=6 !The value of the first TX Level. Etc....
920 Fppwr(2)=7
930 Fppwr(3)=8
940 Fppwr(4)=9
950 Fppwr(5)=11
960 Fppwr(6)=12
970 Fppwr(7)=13
980 Fppwr(8)=14
990 Numfparfcn=3 !The number of ARFCN for fast power test
1000 Fparfcn(1)=1 !The value of the first ARFCN. Etc...
1010 Fparfcn(2)=65
1020 Fparfcn(3)=124
1030 !
1040 !=========================================================================
1050 !
1060 !PRINT MESSAGES ARE DEFINED BELOW
1070 !
1080 Message$(1)=”Answer call when mobile rings”
1090 Message$(2)=”Would you like to test again? (y or n)”
1100 Message$(3)=”Results from Fast Power Measurement”
1110 Message$(4)=”ARFCN TXLEV POWER dBm”
1120 Message$(5)=”Results from Power, Power vs Time & Modulation Measurements”
1130 Message$(6)=”ARFCN TXLEV POWER dBm Pk & RMS PHASE FREQ ERROR MASK”
2-30
GPIB Tutorial and Examples
Program 2
1140 Message$(7)=”Results from BER Test”
1150 Message$(8)=”ARFCN Downlink dBm BER1% RxQual RxLev TIMERR”
1160 Message$(9)=” Seconds.”
1170 Message$(10)=”Time for phone to camp and answer page: “
1180 Message$(11)=”Time for testing : “
1190 Message$(12)=”Time for call clear down : “
1200 !
1210 Emptyst$=”@”
1220 Empty=-999
1230 Nullst$(1,1)=Emptyst$
1240 Null(1,1)=Empty
1250 !
1260 !==========================================================================
1270 !
1280 !ERROR AND TIMEOUT HANDLING
1290 !
1300 Busport=INT(Uut/100)!Get the GPIB port code from Uut
address
1310 CLEAR Busport!Clear bus from any aborted previous
commands
1320 Timeinit$=”yes”!Set a flag so timeout code is not
executed first pass
1330 ON TIMEOUT Busport,Timeouttime GOTO Timeflag!Establish goto flag
for HPIB timeouts
1340 Timeflag:IF Timeinit$<>”yes” THEN!After a timeout, execution comes
here
1350 OFF TIMEOUT Busport
1360 CLEAR Busport !Clear any half done commands
1370 OUTPUT Uut;”TRIG:AST ‘disarm’” !Dissarm the DSP trigger
1380CALL Sub_syserror(Uut,Error$(*),Errcount)!Gather any error message from the
Agilent 8922M/S
1390 PRINT “Measurement Timed Out. Ending Test”
1400 IF Errcount=0 THEN
1410 Errcount=1
1420 Error$(1)=”No errors recorded”
1430 END IF
1440 FOR X=1 TO Errcount !Print error messages
1450 PRINT Error$(X)
1460 NEXT X
1470STOP!Execution stops here after critical
errors
1480 ELSE
1490Timeinit$=”no”!Reset flag so next time, it must
be a real timeout
1500 END IF
1510 Errcount=0
1520 CALL Sub_syserror(Uut,Error$(*),Errcount) !Clear any old errors from
Agilent 8922M/S before the
1530 Errcount=0 !test begins
1540 !
1550 !===========================================================================
1560 !
1570 !PRESET THE HP 8922M/S AND SET IT TO THE CORRECT COMPATIBILITY MODE (executed
once only)
1580 !
1590 !
1600 OUTPUT Uut;”*RST” !Preset the Agilent 8922M/S
1610 OUTPUT Uut;”CONF:COMP?”!Check compatability mode and set
to M or S
1620 ENTER Uut;Product$
1630 IF Product$<>”””8922S””” AND Product$<>”””8922M””” THEN
1640 IF Product$=”””8922E””” THEN OUTPUT Uut;”CONF:COMP ‘8922S’”
1650 IF Product$=”””8922G””” THEN OUTPUT Uut;”CONF:COMP ‘8922M’”
1660OUTPUT Uut;”*RST”!A preset is needed after compatability change
1670 END IF
1680 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any errors logged by
Agilent 8922M/S
2-31
GPIB Tutorial and Examples
Program 2
1690 !
1700
!================================================================================
1710 !
1720 !CREATE CA AND MA TABLES FOR HOPPED TCH (executed once only)
1730 !
1740 !
1750 OUTPUT Uut;”DISP:SCR CCON” !Display the cell config screen
1760 OUTPUT Uut;”CCON:STATE ‘settable’”!Take the cell down to edit CA and
MA tables
1770 Mano=0 !Count for number of MA entries
1780 Ca$=””!String will be used for CA table
1790 FOR X=1 TO 124!Count through 124 possible ARFCN
1800Bit$=”0”!Set CA table entry initially to zero
1810 FOR Y=1 TO Numfparfcn !Check all fast power ARFCN for
ARFCN X
1820IF Fparfcn(Y)=X THEN Bit$=”1”!If ARFCN = X make this CA entry
a one
1830 NEXT Y
1840 FOR Y=1 TO Numdsparfcn !Similarly check DSP ARFCN
1850 IF Dsparfcn(Y)=X THEN Bit$=”1”
1860 NEXT Y
1870 Ca$=Ca$&Bit$ !Add this digit to CA string
1880IF Bit$=”1” THEN Mano=Mano+1!If the entry is one, there will
need to be an MA entry
1890 NEXT X
1900 FOR X=1 TO 63 !Count through the MA table
1910 Bit$=”0” !Initial value for MA digit X
1920 IF Mano>0 THEN Bit$=”1” !Place the same nomber of 1s in
the MA as in the CA
1930 Mano=Mano-1
1940 Ma$=Ma$&Bit$
1950 NEXT X
1960 OUTPUT Uut;”CCON:CA “&”’”&Ca$&”’” !Output the CA and MA tables
1970 OUTPUT Uut;”CCON:MA1 “&”’”&Ma$&”’”
1980 OUTPUT Uut;”CCON:MA2 “&”’”&Ma$&”’”
1990 OUTPUT Uut;”DISP:SCR CELL1”!Display the cell control screen,
and select +
2000 OUTPUT Uut;”CELL:MODE ‘ACTIVE CELL +’”!mode for hopped call. Mode change
activates cell
2010 !
2020 !
2030 !============================================================================
2040 !
2050 !SET THE Agilent 8922M/S INITIAL CONDITIONS (executed once only)
2060 !
2070 !
2080 OUTPUT Uut;”MSINFO:PAGING:IMSI “&Imsi$ !Set the paging IMSI
2090 OUTPUT Uut;”CONF:OFL:RFIN “;Extloss !Set the external cable loss
2100 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Dsparfcn(1) !Set the ARFCN to the first
expected test point
2110 OUTPUT Uut;”CELL:MS:TLEV “;Dsppwr(1) !Set the mobile Tx Level to the
first test point
2120 OUTPUT Uut;”CONF:OFL:MODE ‘ON’”!Turn external offset mode ON to
use cable loss
2130 OUTPUT Uut;”CW:PMZERO” !Zero the power meter
2140 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr!Set the downlink power for normal
signalling
2150 OUTPUT Uut;”TRIG:MODE ‘SINGLE’”!Set the DSP meas trigger to single
trig mode
2160 OUTPUT Uut;”TRIG:BET ‘SINGLE’”!Set bit error meas trigger to single trig mode
2170 OUTPUT Uut;”BET:BITS1 “;Bits1!Set the number of bits to be measured for bit error
2180 OUTPUT Uut;”DISP:SCR DSP” !Display the DSP amplitude main
screen to enter limits
2190 OUTPUT Uut;”DISP:SCR:DSP:VIEW ‘AMPL MAIN’” !for power versus time mask
2-32
GPIB Tutorial and Examples
Program 2
2200 DATA -40,-28,-18,-10,0,180,360,542.769,547.769,552.769,560.769,570.769 !Mask
corner times in us
2210 DATA -36,-30,-6,4,1,1,1,1,1,-6,-30,-36 !Upper
limits in dB
2220 DATA -60,-60,-60,-60,-1,-1,-1,-1,-60,-60,-60,-60!Lower limits in dB
2230 FOR X=1 TO 12
2240 READ Masktim !Reas corner times
from DATA statement
2250 Masktim=Masktim/1.E+6 !Convert seconds
2260 Num$=VAL$(X) !Convert index to
string for HPIB
2270OUTPUT Uut;”DSP:AMPL:”&”time”&Num$&” “;Masktim!Output marker times
2280 NEXT X
2290 FOR X=1 TO 12
2300READ Maskup!Read and output upper
limits
2310 Num$=VAL$(X)
2320 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM “;Maskup
2330 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM:STATE ON”
2340 NEXT X
2350 FOR X=1 TO 12
2360READ Masklo!Read and output lower
limits
2370 Num$=VAL$(X)
2380 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM “;Masklo
2390 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM:STATE ON”
2400 NEXT X
2410 !
2420
!=================================================================================
2430 !
2440 !ESTABLISH A LOOP TO BE EXECUTED EACH TIME A MOBILE IS TESTED
2450 !
2460 !
2470 Run$=”yes”!Flag for REPEAT loop
2480 REPEAT
2490 Clock(1)=TIMEDATE !Start a test time
clock for call set up
2500 !
2510
!=================================================================================
2520 !
2530 !PAGE THE MOBILE AND ESTABLISH A CALL
2540 !
2550 !
2560 OUTPUT Uut;”DISP:SCR CELL1” !Display the cell
control screen
2570PRINT Message$(1)!Output answer call
message
2580OUTPUT Uut;”CELL:TCH1:MODE ‘hopped’”!Set the TCH to hop
mode
2590 OUTPUT Uut;”CELL:CALL:ORIGINATE” !Page mobile
Agilent 8922M/S org call
2600Time=0!Set counter for mobile
to answer
2610 Maxtime=100
2620 REPEAT
2630 Time=Time+1
2640 WAIT 1
2650OUTPUT Uut;”CELL:CALL:STATUS:STATE?”!Check the call status
for connected
2660 ENTER Uut;Status$
2670 UNTIL Status$=”””CONNECTED””” OR Time>Maxtime
2680 IF Time>Maxtime THEN
2690 Errcount=Errcount+1
2700 Error$(Errcount)=”Call could not be established”
2-33
GPIB Tutorial and Examples
Program 2
2710 GOTO Timeflag !If wait too long,
goto timeout code
2720 END IF
2730 !
2740
!===================================================================================
2750 !
2760Clock(1)=TIMEDATE-Clock(1)!End call set up timer
2770Clock(2)=TIMEDATE!Start measurement timer
2780 !
2790
!===================================================================================
2800 !
2810 !UNCOUPLE Agilent 8922M/S RF ANALYZER FROM GSM BASE STATION EMULATOR
2820 !
2830OUTPUT Uut;”CELL:MS:TADV:MODE ‘manual’”!Fix timing advance
at 0 so 8922 doesn’t auto adjust
2840OUTPUT Uut;”TRIG:DDEM:AST ‘disarm’”!Disable the uplink
demodulator
2850OUTPUT Uut;”HOPC:RFAN:AST ‘disarm’”!Stop the RF Analyzer
from hopping
2860 OUTPUT Uut;”HOPC:RFAN:MODE ‘non-hop’”
2870OUTPUT Uut;”TRIG:SOUR ‘rf rise’”!Trigger measurements
from RF rise, when the
2880OUTPUT Uut;”TRIG:DEL 0”!signal falls within
the IF bandwidth
2890 !
2900
!===================================================================================
2910 !
2920 !PERFORM DSP MEASUREMENTS
2930 !
2940 OUTPUT Uut;”DISP DSP” !Return to the DSP
amplitude main screen
2950 FOR Txcount=1 TO Numdsppwr !Outer loop for Tx
levels
2960Txlev=Dsppwr(Txcount)!Get Tx level from array
2970OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Program mobile’s Tx
level
2980 Txlevchange$=”true”
2990FOR Arcount=1 TO Numdsparfcn!Inner loop for ARFCN
3000Arfcn=Dsparfcn(Arcount)!Get ARFCN from array
3010Freq=(890+Arfcn*.2)*1000000!Calculate ARFCN frequency
3020OUTPUT Uut;”RFAN:FREQ “;Freq!Tune the RF Analyzer
to select individual ARFCN
3030 Count=0 !Establish counter
for repeat measurements
3040REPEAT!May need to repeat
if mobile not settled
3050OUTPUT Uut;”TRIG:AST ‘ARM’”!Arm the DSP measurement
3060 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:RMS?” !Read all the DSP
results: rms phase error
3070 ENTER Uut;Rmspher(Arcount,Txcount)
3080 !Note: program will stick here, waiting for input if mobile fails to provide a
valid signal to trigger
3090 !the Agilent 8922M/S. The program will timeout. The timeout code dissarms
the Agilent 8922M/S trigger.
3100OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:PEAK?” !
peak phase error
3110 ENTER Uut;Pkpher(Arcount,Txcount)
3120 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:FREQUENCY?”! frequency error
3130 ENTER Uut;Frer(Arcount,Txcount)
3140OUTPUT Uut;”MEASURE:DSPANALYZER:MSUM?”!
power versus time mask
3150 ENTER Uut;Mask$(Arcount,Txcount)
2-34
GPIB Tutorial and Examples
Program 2
3160OUTPUT Uut;”MEASURE:DSPANALYZER:PTCP?”!
Tx power
3170 ENTER Uut;Slpwr(Arcount,Txcount)
3180OUTPUT Uut;”RFAN:AMPL1?”!Read expected power
level to compare with
3190ENTER Uut;Anlevel!measured and +/-3dB
allowed range
3200 OUTPUT Uut;”MEASURE:DSPANALYZER:SSTATUS?” !Check for any DSP
measurement errors
3210 ENTER Uut;Sstatus$
3220Threedb=ABS(Anlevel-Slpwr(Arcount,Txcount))!Calculate difference
between measured and expected
3230 Count=Count+1
3240UNTIL Count=3 OR Threedb<Leveltol OR Txlevchange$=”false” !Re-do DSP once
if phone fails, the mobile
3250IF Sstatus$<>”””No Error””” OR Threedb>3 THEN!may still be settling
after Tx Level change
3260Err$=”DSP Measurement Problem “!Create an error message string
3270 IF Sstatus$<>”””No Error””” THEN Err$=Err$&Sstatus$
3280 IF Threedb>3 THEN Err$=Err$&” 3dB input range exceeded”
3290 Errcount=Errcount+1
3300 Error$(Errcount)=Err$
3310 END IF
3320 Txlevchange$=”false”
3330 NEXT Arcount
3340 NEXT Txcount
3350 !
3360
!==================================================================================
3370 !
3380 !PERFORM FAST POWER MEASUREMENTS
3390 !
3400OUTPUT Uut;”DISP:SCR CELL1”!Display cell control
screen
3410FOR Txcount=Numfppwr TO 1 STEP -1!Outer loop for mobile
Tx levels
3420Txlev=Fppwr(Txcount)!Get Tx level from array
3430OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Program mobile’s Tx
level
3440 Txlevchange$=”true”
3450FOR Arcount=1 TO Numfparfcn!Inner loop for ARFCN
3460Arfcn=Fparfcn(Arcount)!Get ARFCN from array
3470Freq=(890+Arfcn*.2)*1000000!Calculate frequency
from ARFCN
3480 OUTPUT Uut;”RFAN:FREQ “;Freq !Tune analyzer frequency
3490Txlevcount=0!Count for Tx Level
settling
3500REPEAT!Loop while mobile Tx
Level settles
3510Count=0!Count for inner loop
3520 Fastpower1=0 !Swap variable for
fast power measurement
3530 REPEAT !Loop untill value
stabalizes after analyzer
3540 Fastpower2=Fastpower1 !tuning.
3550OUTPUT Uut;”MEAS:FTCP:POW?”!read the peak power
meter
3560 ENTER Uut;Fastpower1
3570Deltapower=ABS(Fastpower1-Fastpower2)!Look for change since
last measurement
3580 Count=Count+1 !Though away 4 old
readings (in Agilent 8922M/S
3590 UNTIL (Count>4 AND Deltapower<Fpthreshold) OR Count>10 !measuremement
pipline) then look for settled
3600 IF Count>10 THEN !value on new measurement ARFCN. If it never
2-35
GPIB Tutorial and Examples
Program 2
3610Errcount=Errcount+1!settles note an error
3620 Error$(Errcount)=”Mobile’s output power did not settle within
‘Fpthreshold’ limits”
3630 END IF
3640 Fpwrmeas(Arcount,Txcount)=(Fastpower1+Fastpower2)/2 !Average last two
good readings
3650 OUTPUT Uut;”RFAN:AMPL1?” !Read the
Agilent 8922M/S analyzer expected input level
3660ENTER Uut;Anlevel!and compare with the
measured power to check that
3670Threedb=ABS(Anlevel-Fpwrmeas(Arcount,Txcount))!the result is within
the allowed +/-3dB window
3680 Txlevcount=Txlevcount+1
3690 UNTIL Threedb<Leveltol OR Txlevcount>10 OR Txlevchange$=”false”
3700 IF Threedb>3 THEN
3710 Errcount=Errcount+1
3720 Error$(Errcount)=”Fast power meas 3dB input range exceeded”
3730 END IF
3740 Txlevchange$=”false”
3750 NEXT Arcount
3760 NEXT Txcount
3770 !
3780
!==================================================================================
3790 !
3800 !RE-COUPLE Agilent 8922M/S RF ANALYZER TO BASE STATION EMULATOR
3810 !
3820 OUTPUT Uut;”TRIG:DEL 473.4T” !Set approx three
timeslot delay for internal
3830 OUTPUT Uut;”TRIG:SOUR ‘ext demod’” !downlink trigger,
and select downlink trigger
3840OUTPUT Uut;”HOPC:RFAN:MODE ‘hop’”!Set analyzer back to
hopping mode
3850 OUTPUT Uut;”HOPC:RFAN:AST ‘arm’” !Re-enable hopping
3860OUTPUT Uut;”TRIG:DDEM:AST ‘arm’”!Re-enable the uplink
demodulator
3870 OUTPUT Uut;”CELL:MS:TADV:MODE ‘auto’” !Return to default
timing advance mode
3880 !
3890
!==================================================================================
3900 !
3910 !PERFORM BIT ERROR MEASUREMENTS
3920 !!Note: 4 BER measurements
can be made in parallel
3930OUTPUT Uut;”DISP:SCR BER1”!Display single BER
test screen
3940 OUTPUT Uut;”CELL:TCH1:MODE ‘single’” !Return to non-hop
TCH. Next channel change executes FACCH
3950FOR Rxcount=1 TO Numberpwr!Outer loop for downlink power levels
3960Berpo=Berpwr(Rxcount)!Get downlink power
level from array
3970OUTPUT Uut;”RFG:AMPL1 “;Berpo!Program Agilent 8922M/
S Generator to downlink power
3980Count=0!Establish a loop to
wait for the mobile’s receiver
3990Instance=0!AGC to recover from
downlink level change.
4000REPEAT!The mobile’s reported
RXQual will indicate when
4010 OUTPUT Uut;”MEAS:CELL:SACCH:RESET” !the AGC has recovered. Start by clearing old SACCH
4020Count=Count+1!The inner REPEAT loop
is used to check and wait
4030Rxqualsettle=-1!for the next SACCH
report from mobile. When the
2-36
GPIB Tutorial and Examples
Program 2
4040Time=0!Agilent 8922M/S is
waiting for a report, after a SACCH
4050REPEAT!reset it returns -1
4060 WAIT .3 !Pause. SACCH is a
low bandwidth channel.
4070 Time=Time+1
4080OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RQU?”!Read the SACCH report
from the mobile
4090 ENTER Uut;Rxqualsettle !-1 is returned if
Agilent 8922M/S is still waiting
4100 UNTIL Time>7 OR Rxqualsettle<>-1 !for the report
4110 IF Rxqualsettle<=4 THEN !If RxQual is less
than 4, it’s good enough to
4120Instance=Instance+1!continue. The program
checks for more than
4130ELSE!3 consecutive reports
at RxQual 4 or less to
4140Instance=0!be be sure the mobile
has stabalized. The
4150END IF!mobile may return up
to 2 reports at the old
4160 UNTIL Count>20 OR Instance>3 !level, before it
recognizes the input level
4170 IF Count>20 OR Rxqualsettle=-1 THEN !change
4180Errcount=Errcount+1!If RxQual does not
stabalize, report an error
4190 Error$(Errcount)=”Mobile receiver AGC did not respond to downlink level
change”
4200 END IF
4210FOR Arcount=1 TO Numberarfcn!Inner loop for BER
test ARFCN
4220Arfcn=Berarfcn(Arcount)!Get ARFCN from array
4230 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn !Request channel
assignment. Agilllent 8922M/S will hold
4240OUTPUT Uut;”TRIG:BET:MODE ‘RUN’”!off BER test until
channel change is done. Run test.
4250 OUTPUT Uut;”MEAS:CELL:SACCH:RESET” !While BER test is
running, test SACCH reports
4260 Rxlev(Arcount,Rxcount)=-1 !Clear old reports
4270 Time=0
4280 REPEAT !Loop and wait for
SACCH report. -1 is returned
4290WAIT .3!when HP 8922M/S is
waiting for report
4300 Time=Time+1
4310 OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RLEV?” !Read RxLev
4320 ENTER Uut;Rxlev(Arcount,Rxcount)
4330 OUTPUT Uut;”MEAS:CELL:SACCH:PARTIAL:RQU?” !Read RxQual
4340 ENTER Uut;Rxqual(Arcount,Rxcount)
4350 OUTPUT Uut;”MEAS:CELL:MS:TERR?” !Also read uplink
timing error
4360 ENTER Uut;Txtim(Arcount,Rxcount)
4370UNTIL Time>7 OR Rxlev(Arcount,Rxcount)<>-1!Try again if SACCH
report not ready
4380OUTPUT Uut;”MEAS:BET:BERR:RATIO1?”!Read bit error test
result
4390 ENTER Uut;Ber1(Arcount,Rxcount)
4400Ber1(Arcount,Rxcount)=Ber1(Arcount,Rxcount)/10000!Convert from ppm to
%
4410 NEXT Arcount
4420 NEXT Rxcount
4430 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr !Reset downlink to
normal power
4440 !
4450
!================================================================================
4460 !
4470Clock(2)=TIMEDATE-Clock(2)!Stop measurement timer
2-37
GPIB Tutorial and Examples
Program 2
4480Clock(3)=TIMEDATE!Start call clearing
timer
4490 !
4500
!================================================================================
4510 !
4520 !END THE CALL
4530 !
4540 OUTPUT Uut;”DISP CELL1” !Display the cell
control screen
4550OUTPUT Uut;”CELL:CALL:END”!Request a call termination
4560Time=0!Establish a loop to
wait for the mobile
4570 REPEAT !to clear the call
4580 Time=Time+1
4590 WAIT 1
4600OUTPUT Uut;”CELL:CALL:STATUS:STATE?”!Check the call status
4610 ENTER Uut;Status$
4620UNTIL Status$=”””INACTIVE””” OR Time>30!Call status will go
to inactive when the
4630 IF Time>30 THEN !mobile has cleared
4640 Errcount=Errcount+1
4650Error$(Errcount)=”Mobile failed to end call”!Log an error if the
mobile fails to clear
4660GOTO Timeflag!and go to the timeout
code
4670 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any
Agilent 8922M/S logged errors
4680 END IF
4690OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Dsparfcn(1)!Reset the ARFCN and
mobile Tx level ready
4700OUTPUT Uut;”CELL:MS:TLEV “;Dsppwr(1)!to begin testing the
next phone
4710
!===================================================================================
4720 !
4730Clock(3)=TIMEDATE-Clock(3)!Stop the call clearing
timer
4740 !
4750
!====================================================================================
4760 !
4770 !PRINT MEASUREMENT RESULTS
4780 !
4790 CALL
Sub_printit(Fparfcn(*),Fppwr(*),Fpwrmeas(*),Null(*),Null(*),Null(*),Null(*),Nullst$(*
),Numfparfcn,Numfppwr,Message$(3),Message$(4),Emptyst$,Empty)
4800 CALL
Sub_printit(Dsparfcn(*),Dsppwr(*),Slpwr(*),Pkpher(*),Rmspher(*),Frer(*),Null(*),Mask$
(*),Numdsparfcn,Numdsppwr,Message$(5),Message$(6),Emptyst$,Empty)
4810 CALL
Sub_printit(Berarfcn(*),Berpwr(*),Ber1(*),Rxqual(*),Rxlev(*),Txtim(*),Null(*),Nullst$
(*),Numberarfcn,Numberpwr,Message$(7),Message$(8),Emptyst$,Empty)
4820 !
4830
!====================================================================================
4840 !
4850 !PRINT TEST TIMES AND ERROR MESSAGES
4860 !
4870 !
4880 FOR X=1 TO 3
4890 PRINT Message$(X+9);DROUND(Clock(X),4);Message$(9)
4900 NEXT X
4910 PRINT
4920 PRINT
4930 IF Errcount=0 THEN
4940 Errcount=1
2-38
GPIB Tutorial and Examples
Program 2
4950 Error$(1)=”No Errors”
4960 END IF
4970 FOR X=1 TO Errcount
4980 PRINT Error$(X)
4990 NEXT X
5000 Errcount=0
5010 !
5020
!==================================================================================
5030 !
5040 !LOOP IF ANOTHER PHONE IS TO BE TESTED
5050 !
5060 PRINT Message$(2)
5070 INPUT Answer$
5080 Run$=”no”
5090 IF Answer$=”Y” OR Answer$=”y” THEN Run$=”yes”
5100 UNTIL Run$<>”yes”
5110 END
5120 !
5130
!====================================================================================
5140 !SUBROUTINES BELOW
5150
!====================================================================================
5160 !
5170 !RESULTS PRINTING SUBROUTINE
5180 !
5190 SUB
Sub_printit(Result1(*),Result2(*),Result3(*),Result4(*),Result5(*),Result6(*),Result7
(*),Result8$(*),Numarfcn,Numpwr,Title$,Heading$,Emptyst$,Empty)
5200 PRINT Title$
5210 PRINT
5220 PRINT Heading$
5230 FOR Arcount=1 TO Numarfcn
5240 FOR Txcount=1 TO Numpwr
5250 PRINT Result1(Arcount),
5260 PRINT Result2(Txcount),
5270 IF Result3(1,1)<>Empty THEN PRINT DROUND(Result3(Arcount,Txcount),4),
5280 IF Result4(1,1)<>Empty THEN PRINT DROUND(Result4(Arcount,Txcount),4),
5290 IF Result5(1,1)<>Empty THEN PRINT DROUND(Result5(Arcount,Txcount),4),
5300 IF Result6(1,1)<>Empty THEN PRINT DROUND(Result6(Arcount,Txcount),4),
5310 IF Result7(1,1)<>Empty THEN PRINT DROUND(Result7(Arcount,Txcount),4),
5320 IF Result8$(1,1)<>Emptyst$ THEN PRINT Result8$(Arcount,Txcount),
5330 PRINT
5340 NEXT Txcount
5350 NEXT Arcount
5360 PRINT
5370 SUBEND
5380 !
5390 !=============================================================================
5400 !
5410 !CHECK FOR Agilent 8922M/S SYSTEM ERRORS
5420 !
5430 SUB Sub_syserror(Uut,Error$(*),Errcount)
5440 DIM Systemerror$[100]
5450 REPEAT !Set up a loop to drain the
Agilent 8922M/S error stack
5460OUTPUT Uut;”SYSTEM:ERROR?”!Read the last error from the
stack
5470 ENTER Uut;Systemerror$
5480 IF VAL(Systemerror$)<>0 THEN !Code 0 indicates no error
5490Errcount=Errcount+1!If not zero, add the error to
the programs error array
5500 Error$(Errcount)=Systemerror$
5510 END IF
5520UNTIL VAL(Systemerror$)=0!End when all the errors have
been read
5530 SUBEND
2-39
GPIB Tutorial and Examples
Program 3
5540 !
5550 !==============================================================================
5560 !end of program
Program 3
0 !RE-STORE “PROG3”
20 !RE-SAVE “PROG3:,1404”
30 !=========================================================================
40 !
50 !Example program 3
60 !
70!GPIB program to demonstrate techniques for measuring a GSM mobile opperating in
test mode using
80!the Agilent 8922M and S GSM MS Test Sets. The program uses the Agilent 8922M/S
Aux RF Out port to simulate
90!the test mode mobile. In all other respects, the Agilent 8922M/S is configured
to measure a mobile
100 !without the use of over-the-air signalling. The program measures: Tx power,
power versus time,
110 !phase and frequency error and bit error ratio.
120 !
130 !(c) Agilent Technologies 1996
140 !
150 !Rev 1.0
160 !I R HP QMD 7.9.94
170 !Slightly modified by C B 24.1.96 - Changed F/H to M/S throughout
180 !============================================================================
190 !
200 DIM Berpwr(5) !Downlink power levels in dBm for bit error test
210 DIM Berarfcn(125) !ARFCN to perform bit error test on
220 DIM Dsppwr(15) !Mobile Tx power levels for DSP test
230 DIM Dsparfcn(124) !ARFCN to perform DSP test on
240 DIM Fparfcn(124) !ARFCN to perform fast power test on
250 DIM Fppwr(15) !Mobile Tx power levels for fast power test
260 DIM Message$(30)[100] !Output strings
270 DIM Error$(50)[100] !Error message strings
280 DIM Err$[100] !Internally used temporary error string
290 DIM Rmspher(50,50) !Measurement results from rms phase error, dimensions(ARFCN,TXLEVEL)
300 DIM Pkpher(50,50) !Measurement results from peak phase error
310 DIM Frer(50,50) !Measurement results from freq error
320DIM Slpwr(50,50)!Measurement results from DSP analyzer power measurement
330 DIM Txtim(50,50) !Tx timing error measurement results
340 DIM Fpwrmeas(50,50) !Measurement results from fast power
350 DIM Ber1(50,50) !Bit error test measurement results, dimensions(ARFCN,Downlink Power)
360 DIM Clock(5) !Test Times
370 DIM Mask$(50,50)[10] !Power versus time limit mask specification
380 DIM Rxqual(50,50) !RxQual measurement results, dimensions(ARFCN,Downlink Power)
390 DIM Rxlev(50,50) !RxLev measurement results
400 DIM Null(50,50) !Empty array
410 DIM Nullst$(50,50)[50] !Empty string array
420DIM Ca$[124]!String for CA (Cell Allocation) table, used for hopping call
430 DIM Ma$[63] !String for MA (Mobile Allocation) table, used for
hopping call
440 !
450 !====================================================================
460 !
2-40
GPIB Tutorial and Examples
Program 3
470 !GENERAL MEASUREMENT SET UP SPECIFIED
480 !
490 Uut=714 !GPIB address of Agilent 8922M/S
500 Extloss=-.5 !Loss of cable linking 8922 to mobile (loss=-xdB)
510 Bchpwr=-80 !BCCH power level in dBm
520 Timeouttime=20 !The GPIB timeout in seconds
530 Leveltol=1 !Power tolerence to indicate TX Level has settled
after change (dB)
540Fpthreshold=.3!Power tolerence for fast power measurement after analyzer channel change (dB)
550 !
560 !======================================================================
570 !
580 !MEASUREMENT POINTS ARE DEFINED IN THIS SECTION
590 !
600 !Bit error ratio test
610 !
620 Numberpwr=1 !The number of downlink power levels for bit error
test
630Berpwr(1)=-102!The power level in dBm of the first downlink power.
Etc....
640Bits1=10000!The number of bits to test at each ARFCN/Power combination
650 Numberarfcn=3 !The number of ARFCN for bit error test
660 Berarfcn(1)=1 !The value of the first ARFCN. Etc....
670 Berarfcn(2)=65
680 Berarfcn(3)=124
690 !
700 !
710 !DSP measurememnts
720 !
730 Numdsppwr=3 !The number of mobile TX Levels for DSP test
740 Dsppwr(1)=5 !The value of the first TX Level. Etc...
750 Dsppwr(2)=10
760 Dsppwr(3)=15
770 Numdsparfcn=3 !The number of ARFCN for DSP test
780 Dsparfcn(1)=1 !The value of the first ARFCN. Etc....
790 Dsparfcn(2)=65
800 Dsparfcn(3)=124
810 !
820 !Fast Power measurements
830 !
840 Numfppwr=8 !The number of mobile TX Levels for fast power test
850 Fppwr(1)=6 !The value of the first TX Level. Etc....
860 Fppwr(2)=7
870 Fppwr(3)=8
880 Fppwr(4)=9
890 Fppwr(5)=11
900 Fppwr(6)=12
910 Fppwr(7)=13
920 Fppwr(8)=14
930 Numfparfcn=3 !The number of ARFCN for fast power test
940 Fparfcn(1)=1 !The value of the first ARFCN. Etc...
950 Fparfcn(2)=65
960 Fparfcn(3)=124
970 !
980 !=========================================================================
990 !
1000 !PRINT MESSAGES ARE DEFINED BELOW
1010 !
1020 Message$(1)=”Answer call when mobile rings”
1030 Message$(2)=”Would you like to test again? (y or n)”
1040 Message$(3)=”Results from Fast Power Measurement”
1050 Message$(4)=”ARFCN TXLEV POWER dBm”
1060 Message$(5)=”Results from Power, Power vs Time & Modulation Measurements”
1070 Message$(6)=”ARFCN TXLEV POWER dBm Pk & RMS PHASE FREQ ERROR MASK”
1080 Message$(7)=”Results from BER Test”
1090 Message$(8)=”ARFCN Downlink dBm BER1% RxQual RxLev TIMERR”
2-41
GPIB Tutorial and Examples
Program 3
1100 Message$(9)=” Seconds.”
1110 Message$(10)=”Time for phone to camp and answer page: “
1120 Message$(11)=”Time for testing : “
1130 Message$(12)=”Time for call clear down : “
1140 !
1150 Emptyst$=”@”
1160 Empty=-999
1170 Nullst$(1,1)=Emptyst$
1180 Null(1,1)=Empty
1190 !
1200 !==========================================================================
1210 !
1220 !ERROR AND TIMEOUT HANDLING
1230 !
1240 Busport=INT(Uut/100)!Get the GPIB port code from Uut
address
1250 CLEAR Busport!Clear bus from any aborted previous
commands
1260 Timeinit$=”yes”!Set a flag so timeout code is not
executed first pass
1270 ON TIMEOUT Busport,Timeouttime GOTO Timeflag!Establish goto flag
for GPIB timeouts
1280 Timeflag:IF Timeinit$<>”yes” THEN!After a timeout, execution comes
here
1290 OFF TIMEOUT Busport
1300 CLEAR Busport !Clear any half done commands
1310 OUTPUT Uut;”TRIG:AST ‘disarm’” !Dissarm the DSP trigger
1320CALL Sub_syserror(Uut,Error$(*),Errcount)!Gather any error message from the
Agilent 8922M/S
1330 PRINT “Measurement Timed Out. Ending Test”
1340 IF Errcount=0 THEN
1350 Errcount=1
1360 Error$(1)=”No errors recorded”
1370 END IF
1380 FOR X=1 TO Errcount !Print error messages
1390 PRINT Error$(X)
1400 NEXT X
1410STOP!Execution stops here after critical
errors
1420 ELSE
1430Timeinit$=”no”!Reset flag so next time, it must
be a real timeout
1440 END IF
1450 Errcount=0
1460 CALL Sub_syserror(Uut,Error$(*),Errcount) !Clear any old errors from
Agilent 8922M/S before the
1470 Errcount=0 !test begins
1480 !
1490 !===========================================================================
1500 !
1510 !PRESET THE Agilent 8922M/S AND SET IT TO THE CORRECT COMPATIBILITY MODE (executed once only)
1520 !
1530 !
1540 OUTPUT Uut;”*RST” !Preset the Agilent 8922M/S
1550 OUTPUT Uut;”CONF:COMP?”!Check compatability mode and set
to F or H
1560 ENTER Uut;Product$
1570 IF Product$<>”””8922S””” AND Product$<>”””8922M””” THEN
1580 IF Product$=”””8922E””” THEN OUTPUT Uut;”CONF:COMP ‘8922S’”
1590 IF Product$=”””8922G””” THEN OUTPUT Uut;”CONF:COMP ‘8922M’”
1600OUTPUT Uut;”*RST”!A preset is needed after compatability change
1610 END IF
1620 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any errors logged by
Agilent 8922M/S
1630 !
2-42
GPIB Tutorial and Examples
Program 3
1640
!================================================================================
1650 !
1660 !SELECT Agilent 8922M/S OPPERATING MODE TO SUITE MOBILES IN TEST MODE (executed
once only)
1670 !
1680 OUTPUT Uut;”CELL:MODE ‘TEST MODE’” !Select Test Mode opperation
1690 !
1700 !
1710 !============================================================================
1720 !
1730 !SET THE Agilent 8922M/S INITIAL CONDITIONS (executed once only)
1740 !
1750 !
1760 OUTPUT Uut;”CONF:OFL:RFIN “;Extloss !Set the external cable loss
1770 OUTPUT Uut;”CONF:OFL:MODE ‘ON’”!Turn external offset mode ON to
use cable loss
1780 OUTPUT Uut;”CW:PMZERO” !Zero the power meter
1790 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr!Set the downlink power for normal
signalling
1800 OUTPUT Uut;”TRIG:MODE ‘SINGLE’”!Set the DSP meas trigger to single
trig mode
1810 OUTPUT Uut;”TRIG:BET ‘SINGLE’”!Set bit error meas trigger to single trig mode
1820 OUTPUT Uut;”BET:BITS1 “;Bits1!Set the number of bits to be measured for bit error
1830 OUTPUT Uut;”DISP:SCR DSP” !Display the DSP amplitude main
screen to enter limits
1840 OUTPUT Uut;”DISP:SCR:DSP:VIEW ‘AMPL MAIN’” !for power versus time mask
1850 DATA -40,-28,-18,-10,0,180,360,542.769,547.769,552.769,560.769,570.769 !Mask
corner times in us
1860 DATA -36,-30,-6,4,1,1,1,1,1,-6,-30,-36 !Upper
limits in dB
1870 DATA -60,-60,-60,-60,-1,-1,-1,-1,-60,-60,-60,-60!Lower limits in dB
1880 FOR X=1 TO 12
1890 READ Masktim !Reas corner times
from DATA statement
1900 Masktim=Masktim/1.E+6 !Convert seconds
1910 Num$=VAL$(X) !Convert index to
string for GPIB
1920OUTPUT Uut;”DSP:AMPL:”&”time”&Num$&” “;Masktim!Output marker times
1930 NEXT X
1940 FOR X=1 TO 12
1950READ Maskup!Read and output upper
limits
1960 Num$=VAL$(X)
1970 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM “;Maskup
1980 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:HLIM:STATE ON”
1990 NEXT X
2000 FOR X=1 TO 12
2010READ Masklo!Read and output lower
limits
2020 Num$=VAL$(X)
2030 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM “;Masklo
2040 OUTPUT Uut;”MEAS:DSP:AMPL:”&”AMPL”&Num$&”:LLIM:STATE ON”
2050 NEXT X
2060 !
2070
!=================================================================================
2080 !
2090 !CALL SUBROUTINE ASKING USER TO MAKE APROPRIATE CABLE CONNECTIONS
2100 !
2110 CALL Sub_trickmobile(Uut,”CABLE”,0,0,Trickfreq,0)!Ask user to connect
Agilent 8922M/S ports to
2120 !!emulate a mobile in
test mode
2130 !
2-43
GPIB Tutorial and Examples
Program 3
2140
!=================================================================================
2150 !
2160 !ESTABLISH A LOOP TO BE EXECUTED EACH TIME A MOBILE IS TESTED
2170 !
2180 !
2190 Run$=”yes”!Flag for REPEAT loop
2200 REPEAT
2210 Clock(1)=TIMEDATE !Start a test time
clock for call set up
2220 !
2230
!=================================================================================
2240 !
2250 !ACTIVATE THE MOBILE IN TEST MODE
2260 !
2270 CALL Sub_trickmobile(Uut,”TXON”,Dsparfcn(1),Dsppwr(1),Trickfreq,Extloss)
!Activate the test mode mobile
2280 !
2290
!===================================================================================
2300 !
2310Clock(1)=TIMEDATE-Clock(1)!End call set up timer
2320Clock(2)=TIMEDATE!Start measurement timer
2330 !
2340
!===================================================================================
2350 !
2360 !PERFORM DSP MEASUREMENTS
2370 !
2380 OUTPUT Uut;”DISP DSP” !Return to the DSP
amplitude main screen
2390 FOR Txcount=1 TO Numdsppwr !Outer loop for Tx
levels
2400Txlev=Dsppwr(Txcount)!Get Tx level from array
2410OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Adjust Analyzer to
correct power for mobile
2420 CALL Sub_trickmobile(Uut,”TXLEV”,0,Txlev,Trickfreq,Extloss) !Command test
mode mobile to new Tx Level
2430 Txlevchange$=”true”
2440FOR Arcount=1 TO Numdsparfcn!Inner loop for ARFCN
2450Arfcn=Dsparfcn(Arcount)!Get ARFCN from array
2460Freq=(890+Arfcn*.2)*1000000!Calculate ARFCN frequency
2470CALL Sub_trickmobile(Uut,”ARFCN”,Arfcn,0,Freq,Extloss) !Command test mode
mobile to new ARFCN
2480 OUTPUT Uut;”RFAN:FREQ “;Freq !Tune Analyzer to
correct frequency
2490 Count=0 !Establish counter
for repeat measurements
2500REPEAT!May need to repeat
if mobile not settled
2510OUTPUT Uut;”TRIG:AST ‘ARM’”!Arm the DSP measurement
2520 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:RMS?” !Read all the DSP
results: rms phase error
2530 ENTER Uut;Rmspher(Arcount,Txcount)
2540 !Note: program will stick here, waiting for input if mobile fails to provide a
valid signal to trigger
2550 !the HP 8922M/S. The program will timeout. The timeout code dissarms the
Agilent 8922M/S trigger.
2560OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:PEAK?” !
peak phase error
2570 ENTER Uut;Pkpher(Arcount,Txcount)
2580 OUTPUT Uut;”MEASURE:DSPANALYZER:PHASE:ERROR:FREQUENCY?”! frequency error
2590 ENTER Uut;Frer(Arcount,Txcount)
2-44
GPIB Tutorial and Examples
Program 3
2600OUTPUT Uut;”MEASURE:DSPANALYZER:MSUM?”!
power versus time mask
2610 ENTER Uut;Mask$(Arcount,Txcount)
2620OUTPUT Uut;”MEASURE:DSPANALYZER:PTCP?”!
Tx power
2630 ENTER Uut;Slpwr(Arcount,Txcount)
2640OUTPUT Uut;”RFAN:AMPL1?”!Read expected power
level to compare with
2650ENTER Uut;Anlevel!measured and +/-3dB
allowed range
2660 OUTPUT Uut;”MEASURE:DSPANALYZER:SSTATUS?” !Check for any DSP
measurement errors
2670 ENTER Uut;Sstatus$
2680Threedb=ABS(Anlevel-Slpwr(Arcount,Txcount))!Calculate difference
between measured and expected
2690 Count=Count+1
2700UNTIL Count=3 OR Threedb<Leveltol OR Txlevchange$=”false” !Re-do DSP once
if phone fails, the mobile
2710IF Sstatus$<>”””No Error””” OR Threedb>3 THEN!may still be settling
after Tx Level change
2720Err$=”DSP Measurement Problem “!Create an error message string
2730 IF Sstatus$<>”””No Error””” THEN Err$=Err$&Sstatus$
2740 IF Threedb>3 THEN Err$=Err$&” 3dB input range exceeded”
2750 Errcount=Errcount+1
2760 Error$(Errcount)=Err$
2770 END IF
2780 Txlevchange$=”false”
2790 NEXT Arcount
2800 NEXT Txcount
2810 !
2820
!==================================================================================
2830 !
2840 !PERFORM FAST POWER MEASUREMENTS
2850 !
2860OUTPUT Uut;”DISP:SCR CELL1”!Display cell control
screen
2870FOR Txcount=Numfppwr TO 1 STEP -1!Outer loop for mobile
Tx levels@@@@
2880Txlev=Fppwr(Txcount)!Get Tx level from array
2890OUTPUT Uut;”CELL:MS:TLEV”;Txlev!Adjust analyzer to
correct expected power
2900 CALL Sub_trickmobile(Uut,”TXLEV”,0,Txlev,Trickfreq,Extloss) !Command test
mode mobile to new T Level
2910 Txlevchange$=”true”
2920FOR Arcount=1 TO Numfparfcn!Inner loop for ARFCN
2930Arfcn=Fparfcn(Arcount)!Get ARFCN from array
2940Freq=(890+Arfcn*.2)*1000000!Calculate frequency
from ARFCN
2950CALL Sub_trickmobile(Uut,”ARFCN”,Arfcn,0,Freq,Extloss) !Command test mode
mobile to new ARFCN
2960 OUTPUT Uut;”RFAN:FREQ “;Freq !Tune analyzer frequency
2970Txlevcount=0!Count for Tx Level
settling
2980REPEAT!Loop while mobile Tx
Level settles
2990Count=0!Count for inner loop
3000 Fastpower1=0 !Swap variable for
fast power measurement
3010 REPEAT !Loop untill value
stabalizes after analyzer
3020 Fastpower2=Fastpower1 !tuning.
3030OUTPUT Uut;”MEAS:FTCP:POW?”!read the peak power
meter
3040 ENTER Uut;Fastpower1
2-45
GPIB Tutorial and Examples
Program 3
3050Deltapower=ABS(Fastpower1-Fastpower2)!Look for change since
last measurement
3060 Count=Count+1 !Though away 4 old
readings (in Agilent 8922M/S
3070 UNTIL (Count>4 AND Deltapower<Fpthreshold) OR Count>10 !measuremement
pipline) then look for settled
3080 IF Count>10 THEN !value on new measurement ARFCN. If it never
3090Errcount=Errcount+1!settles note an error
3100 Error$(Errcount)=”Mobile’s output power did not settle within
‘Fpthreshold’ limits”
3110 END IF
3120 Fpwrmeas(Arcount,Txcount)=(Fastpower1+Fastpower2)/2 !Average last two
good readings
3130 OUTPUT Uut;”RFAN:AMPL1?” !Read the
Agilent 8922M/S analyzer expected input level
3140ENTER Uut;Anlevel!and compare with the
measured power to check that
3150Threedb=ABS(Anlevel-Fpwrmeas(Arcount,Txcount))!the result is within
the allowed +/-3dB window
3160 Txlevcount=Txlevcount+1
3170 UNTIL Threedb<Leveltol OR Txlevcount>10 OR Txlevchange$=”false”
3180 IF Threedb>3 THEN
3190 Errcount=Errcount+1
3200 Error$(Errcount)=”Fast power meas 3dB input range exceeded”
3210 END IF
3220 Txlevchange$=”false”
3230 NEXT Arcount
3240 NEXT Txcount
3250 !
3260
!==================================================================================
3270 !
3280 !PERFORM BIT ERROR MEASUREMENTS
3290 !!Note: 4 BER measurements
can be made in parallel
3300OUTPUT Uut;”DISP:SCR BER1”!Display single BER
test screen
3310FOR Rxcount=1 TO Numberpwr!Outer loop for downlink power levels
3320Berpo=Berpwr(Rxcount)!Get downlink power
level from array
3330OUTPUT Uut;”RFG:AMPL1 “;Berpo!Program Agilent 8922M/
S Generator to downlink power
3340FOR Arcount=1 TO Numberarfcn!Inner loop for BER
test ARFCN
3350Arfcn=Berarfcn(Arcount)!Get ARFCN from array
3360Freq=(890+Arfcn*.2)*1000000!Calculate frequency
from ARFCN
3370CALL Sub_trickmobile(Uut,”ARFCN”,Arfcn,0,Freq,Extloss) !Command test mode
mobile to new ARFCN
3380 OUTPUT Uut;”RFAN:FREQ “;Freq !Tune analyzer frequency
3390OUTPUT Uut;”TRIG:BET:MODE ‘RUN’”!off BER test until
channel change is done. Run test.
3400OUTPUT Uut;”MEAS:BET:BERR:RATIO1?”!Read bit error test
result
3410 ENTER Uut;Ber1(Arcount,Rxcount)
3420Ber1(Arcount,Rxcount)=Ber1(Arcount,Rxcount)/10000!Convert from ppm to
%
3430 NEXT Arcount
3440 NEXT Rxcount
3450 OUTPUT Uut;”RFG:AMPL1 “;Bchpwr !Reset downlink to
normal power
3460 !
3470
!================================================================================
3480 !
2-46
GPIB Tutorial and Examples
Program 3
3490Clock(2)=TIMEDATE-Clock(2)!Stop measurement timer
3500Clock(3)=TIMEDATE!Start call clearing
timer
3510 !
3520
!================================================================================
3530 !
3540 !END THE CALL
3550 !
3560 CALL Sub_trickmobile(Uut,”TXOFF”,0,0,Trickfreq,0) !Dissable the test
mode mobile
3570 CALL Sub_syserror(Uut,Error$(*),Errcount) !Check for any
Agilent 8922M/S logged errors
3580 !
3590 !
3600
!===================================================================================
3610 !
3620Clock(3)=TIMEDATE-Clock(3)!Stop the call clearing
timer
3630 !
3640
!====================================================================================
3650 !
3660 !PRINT MEASUREMENT RESULTS
3670 !
3680 CALL
Sub_printit(Fparfcn(*),Fppwr(*),Fpwrmeas(*),Null(*),Null(*),Null(*),Null(*),Nullst$(*
),Numfparfcn,Numfppwr,Message$(3),Message$(4),Emptyst$,Empty)
3690 CALL
Sub_printit(Dsparfcn(*),Dsppwr(*),Slpwr(*),Pkpher(*),Rmspher(*),Frer(*),Null(*),Mask$
(*),Numdsparfcn,Numdsppwr,Message$(5),Message$(6),Emptyst$,Empty)
3700 CALL
Sub_printit(Berarfcn(*),Berpwr(*),Ber1(*),Rxqual(*),Rxlev(*),Txtim(*),Null(*),Nullst$
(*),Numberarfcn,Numberpwr,Message$(7),Message$(8),Emptyst$,Empty)
3710 !
3720
!====================================================================================
3730 !
3740 !PRINT TEST TIMES AND ERROR MESSAGES
3750 !
3760 !
3770 FOR X=1 TO 3
3780 PRINT Message$(X+9);DROUND(Clock(X),4);Message$(9)
3790 NEXT X
3800 PRINT
3810 PRINT
3820 IF Errcount=0 THEN
3830 Errcount=1
3840 Error$(1)=”No Errors”
3850 END IF
3860 FOR X=1 TO Errcount
3870 PRINT Error$(X)
3880 NEXT X
3890 Errcount=0
3900 !
3910
!==================================================================================
3920 !
3930 !LOOP IF ANOTHER PHONE IS TO BE TESTED
3940 !
3950 PRINT Message$(2)
3960 INPUT Answer$
3970 Run$=”no”
3980 IF Answer$=”Y” OR Answer$=”y” THEN Run$=”yes”
3990 UNTIL Run$<>”yes”
4000 END
4010 !
2-47
GPIB Tutorial and Examples
Program 3
4020
!====================================================================================
4030 !SUBROUTINES BELOW
4040
!====================================================================================
4050 !
4060 !RESULTS PRINTING SUBROUTINE
4070 !
4080 SUB
Sub_printit(Result1(*),Result2(*),Result3(*),Result4(*),Result5(*),Result6(*),Result7
(*),Result8$(*),Numarfcn,Numpwr,Title$,Heading$,Emptyst$,Empty)
4090 PRINT Title$
4100 PRINT
4110 PRINT Heading$
4120 FOR Arcount=1 TO Numarfcn
4130 FOR Txcount=1 TO Numpwr
4140 PRINT Result1(Arcount),
4150 PRINT Result2(Txcount),
4160 IF Result3(1,1)<>Empty THEN PRINT DROUND(Result3(Arcount,Txcount),4),
4170 IF Result4(1,1)<>Empty THEN PRINT DROUND(Result4(Arcount,Txcount),4),
4180 IF Result5(1,1)<>Empty THEN PRINT DROUND(Result5(Arcount,Txcount),4),
4190 IF Result6(1,1)<>Empty THEN PRINT DROUND(Result6(Arcount,Txcount),4),
4200 IF Result7(1,1)<>Empty THEN PRINT DROUND(Result7(Arcount,Txcount),4),
4210 IF Result8$(1,1)<>Emptyst$ THEN PRINT Result8$(Arcount,Txcount),
4220 PRINT
4230 NEXT Txcount
4240 NEXT Arcount
4250 PRINT
4260 SUBEND
4270 !
4280 !=============================================================================
4290 !
4300 !CHECK FOR Agilent 8922M/S SYSTEM ERRORS
4310 !
4320 SUB Sub_syserror(Uut,Error$(*),Errcount)
4330 DIM Systemerror$[100]
4340 REPEAT !Set up a loop to drain the
Agilent 8922M/S error stack
4350OUTPUT Uut;”SYSTEM:ERROR?”!Read the last error from the
stack
4360 ENTER Uut;Systemerror$
4370 IF VAL(Systemerror$)<>0 THEN !Code 0 indicates no error
4380Errcount=Errcount+1!If not zero, add the error to
the programs error array
4390 Error$(Errcount)=Systemerror$
4400 END IF
4410UNTIL VAL(Systemerror$)=0!End when all the errors have
been read
4420 SUBEND
4430 !
4440 !==============================================================================
4450 !
4460 !CONFIGURE THE Agilent 8922M/S AUX RF OUT PORT TO EMULATE A MOBILE IN TEST MODE
4470 !
4480 !This subroutine uses unsupported HP-IB commands to ‘trick’ the Agilent 8922M/S
into opperating as if
4490 !a test mode mobile was connected. The Aux RF Out port is configured to emulate
the mobile.
4500 !Replacing this subroutine with one to control a real GSM mobile would allow the
program to be
4510 !used in a real application
4520 !
4530 SUB Sub_trickmobile(Uut,Func$,Arfcn,Txlev,Trickfreq,Extloss)
4540Trickfreq=(935+Arfcn*.2)*1000000!Adjust the uplink frequency
to equal the downlink
4550Trickloss=Extloss+(2*Txlev)-43+7!Adjust the ext loss to simulate Tx Level changes
2-48
GPIB Tutorial and Examples
Program 3
4560IF Func$=”TXON” THEN!These commands configure the
generator to begin
4570 OUTPUT Uut;”RFG:AMPL2 7DBM” !emulating the mobile
4580 OUTPUT Uut;”RFG:OUTP ‘AUX RFOUT’”
4590 OUTPUT Uut;”CONF:OFL:RFIN “;Trickloss
4600 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn
4610 OUTPUT Uut;”CELL:CALL:TCH:TSL 2”
4620 OUTPUT Uut;”CELL:CALL:ORIGINATE”
4630 OUTPUT Uut;”SERV:LATCH:SEL ‘g_pulse_start_trig’”
4640 OUTPUT Uut;”SERV:LATCH:VALUE 1431”
4650 OUTPUT Uut;”SERV:LATCH:SEL ‘g_pulse_stop_trig’”
4660 OUTPUT Uut;”SERV:LATCH:VALUE 1281”
4670 OUTPUT Uut;”SERV:LATCH:SEL ‘g_tx_slot’”
4680 OUTPUT Uut;”SERV:LATCH:VALUE 5”
4690 OUTPUT Uut;”SERV:LATCH:SEL ‘g_mux_a_cntl’”
4700 OUTPUT Uut;”SERV:LATCH:VALUE 75”
4710 OUTPUT Uut;”SERV:LATCH:SEL ‘g_hop_to_bch’”
4720 OUTPUT Uut;”SERV:LATCH:VALUE 1536”
4730 OUTPUT Uut;”RFG:MOD:PULS ‘EXT’”
4740 END IF
4750IF Func$=”ARFCN” THEN!These commands simulate a channel change by
4760 OUTPUT Uut;”CELL:CALL:TCH:ARFCN “;Arfcn !re-tuning the generator
4770 OUTPUT Uut;”SERV:LATCH:SEL ‘g_tx_slot’”
4780 OUTPUT Uut;”SERV:LATCH:VALUE 5”
4790 OUTPUT Uut;”SERV:LATCH:SEL ‘g_mux_a_cntl’”
4800 OUTPUT Uut;”SERV:LATCH:VALUE 75”
4810 OUTPUT Uut;”SERV:LATCH:SEL ‘g_hop_to_bch’”
4820 OUTPUT Uut;”SERV:LATCH:VALUE 1536”
4830 END IF
4840IF Func$=”TXLEV” THEN!These commands simulate a Tx
Level Change
4850 OUTPUT Uut;”CONF:OFL:RFIN “;Trickloss
4860 END IF
4870IF Func$=”TXOFF” THEN!Dissable the TCH to simulate
turning the
4880 OUTPUT Uut;”CELL:CALL:END” !mobile off
4890 END IF
4900 IF Func$=”CABLE” THEN
4910 PRINT
4920 PRINT “Connect a short cable from the Agilent 8922M/S AUX RF OUT”
4930 PRINT “to the RF IN/OUT port”
4940 PRINT
4950 PRINT “Cycle instrument power when testing is complete”
4960 PRINT
4970 PRINT “Press Return when ready”
4980 PRINT
4990 INPUT Dummy$
5000 END IF
5010 SUBEND
5020 !
5030 !============================================================
5040 !end of program
2-49
GPIB Tutorial and Examples
Transient Settling Times
Transient Settling Times
The following transient settling (wait times) should be considered when executing GPIB
programs from an external controller or using the built-in IBASIC controller to execute
programs.
NOTEDuring query loops (especially for IBASICapplications),itisrecommendedtouseaWAIT
statement like WAIT Delta_t, where Delta_t is user defined (i.e. WAIT 0.5 ! wait 0.5
seconds).
1Each of the following operations requireschecking thata certain state has been reached
before continuing with other GPIB commands:
a) Endinga Call. Wait for CELL CONTROL Call Status to be ’INACTIVE’and then
check for Call Status RR to be ’BCCH’.
OUTPUT 714;”CELL:CALL:END”
REPEAT
WAIT Delta_t
OUTPUT 714;”CELL:CALL:STATUS:STATE?” ! Query the Call Status
ENTER 714;Query$
UNTIL Query$=”””INACTIVE”””
IF (Query$=”””INACTIVE”””)
REPEAT
WAIT Delta_t
OUTPUT 714;”CELL:CALL:STAT:RR?” ! Query the RR Call Status
ENTER 714;Query$
UNTIL Query$=”””BCCH”””
END IF
b) Originating a Call. Must wait for CELL CONTROL Call Status to be
’CONNECTED’:
OUTPUT 714;”CELL:CALL:ORIG”
! Answer call when the mobile rings
REPEAT
WAIT Delta_t
OUTPUT 714;”CELL:CALL:STATUS:STATE?” ! Query the Call Status
ENTER 714;Query$
UNTIL Query$=”””CONNECTED”””
2-50
GPIB Tutorial and Examples
Transient Settling Times
c) Setting the Agilent 8922M/S to an Activated state. Must wait for the CELL
CONTROL Signaling (RR) Call Status to be ’BCCH’.
OUTPUT 714;”DISP CCON”
OUTPUT 714;”CCON:STAT ’ACTIVATED’”
DISP ”Waiting for HP 8922M/S to provide BCCH. . .”
REPEAT
WAIT Delta_t
OUTPUT 714;”CELL:CALL:STAT:RR?” ! Query the RR Call Status
ENTER 714;Query$
UNTIL Query$=”””BCCH”””
d) Setting the Agilent 8922M/S back to a Settable state. Must wait for the field to
change its state.
OUTPUT 714;”CCON:STAT ’SETTABLE’”
REPEAT
WAIT Delta_t
OUTPUT 714;”CCON:STAT?” ! Query the Cell Configure state
ENTER 714;Query$
UNTIL Query$=”””SETTABLE”””
e) Doing a PRESET (*RST). Must make sure the call is ended (See (a)).
f) Running a Bit Error Test measurement. Must wait for STOP after a RUN is
executed to query any measurement results.
OUTPUT 714;”DISP BET”
OUTPUT 714;”TRIG:BET:MODE ’RUN’”
REPEAT
WAIT Delta_t
OUTPUT 714;”TRIG:BET:MODE?” ! Query the Bit Error Test
Trigger mode
ENTER 714;Query$
UNTIL Query$=”””STOP”””
g) Querying measurements in SINGLE or CONT (continous) mode. Refer to the
section for querying measurements through GPIB.
2-51
GPIB Tutorial and Examples
Transient Settling Times
2. The following operations may affect how much wait time is needed between GPIB or
IBASIC commands.
a) IBASIC operation - especially tight query loops
b) Continuous measurements
i.DSP Analyzer - Phase, Amplitude and Data Bits measurements
ii. Output RF Spectrum measurements Option 006 only
iii. Pulse On/Off Ratio measurements Option 006 only
iv. Spectrum Analyzer measurements Option 006 only
v. Oscilloscope measurements
vi. CW measurements
vii. AF Analyzer measurements
c) Signaling operations:
i.SACCH measurements
ii. Intercell Handovers
iii. Intracell Handovers
iv. Trace views are active
3. When performing thefollowing operations, include a wait statement for a maximumof
the period of time given, before issuing the next command.
a) Executing Loopback functions - loopback on and off: 1 second
OUTPUT 714,”CELL:AUD:LOOP:OFF” ! loopback off
WAIT 1
OUTPUT 714,”CELL:AUD:LOOP:FE” ! on with frame erasure
WAIT 1
OUTPUT 714,”CELL:AUD:LOOP:NOFE” ! on without frame erasure
WAIT 1
b) Changing Audio Speech Configurations to ’ECHO’: 0.5 second
OUTPUT 714,”CELL:AUD:SPE:CONF ’ECHO’
WAIT 0.5
c) Changing Audio Speech Configurations to ’PRBS’: 2 seconds
OUTPUT 714,”CELL:AUD:SPE:CONF ’PRBS’
WAIT 2
d) Setting the MS TX power Level: 1 second
OUTPUT 714,”CELL:MS:TLEV 7”
WAIT 1
2-52
GPIB Tutorial and Examples
Transient Settling Times
e) Arming DSP Analyzer, Output RF Spectrum or Pulse On/Off measurements in
Single mode from IBASIC - after sendingthe Arm command wait approximately 5
seconds.
OUTPUT 714,”TRIG:ASTate ’ARM’”
WAIT 5
f) IMEI Request: 10 seconds
OUTPUT 714,”MSIN:MS:IMEI:REQ”
- WAIT 10
g) TMSI Reallocation: Query TMSI value (should change within 10 seconds)
iii. Wait until OUTPUT 714,”MSIN:PAG:TMSI?” returns a new string
110 seconds maximum
We expect users, operating remotely, to make measurements in single mode, mainly for
speed reasons. However, if you operate in continuous (CONT) measurement mode and
you change a parameter that affects the measurement result, then (at a maximum) the third
measurement result queried will be an outcome of the new setup and not the previous
setup.
2-53
GPIB Tutorial and Examples
Transient Settling Times
2-54
3
AF Analyzer Subsystem
3-1
AF Analyzer Subsystem
3-2
Continued Over
AF Analyzer Subsystem
3-3
AF Analyzer Subsystem
AIN
AIN
DescriptionSelects/queries the state of the front panel AUDIO IN LO BNC connector. FLOAT means
AUDIO IN LO will be used to generate floating input signal (that is NOT referenced to a
common ground signal). GND means AUDIO IN LO will be connected to a common
ground signal
SyntaxAFANalyzer:AIN?
AFANalyzer:AIN <string>
Options‘FLOAT’ | ‘GND’
DEMPhasis
DescriptionSelects/queries the AF ANalyzer DE-EMPhasis state.
SyntaxAFANalyzer:DEMPhasis?
AFANalyzer:DEMPhasis <string>
Options’750 US’ | ’OFF’
DEMPhasis:GAIN
DescriptionSelects/queries the DE-EMPhasis GAIN selection. Typically, this is selected
automatically, based on audio level.
SyntaxAFANalyzer:DEMPhasis:GAIN?
AFANalyzer:DEMPhasis:GAIN <string>
Options’0 DB’ | ’10 DB’ | ’20 DB’ | ’30 DB’
DETector
DescriptionSelects/queries the AF Analyzer Detectorwhich isused for all AF Analyzer measurements.
SyntaxAFANalyzer:DETector?
DescriptionSelects/queries the RANGing (Gain Cntl) STATe.
SyntaxAFANalyzer:RANGing?
AFANalyzer:RANGing <string>
Options’AUTO’ | ’HOLD’
Where;
•AUTO results in gain selections being made automatically based on audio level.
•HOLD causes all gain selections to maintain their present state for either manual
selection or until AUTO is selected.
SPEaker:MODE
DescriptionSelects/queries the SPEaker ALC MODE.
SyntaxAFANalyzer:SPEaker:MODE?
AFANalyzer:SPEaker:MODE <string>
Options’ON’ | ’OFF’
NOTEThis command is not available for the Agilent 8922S.
SPEaker:VOLume
DescriptionSelects/queries the SPEaker VOLume.
SyntaxAFANalyzer:SPEaker:VOLume?
AFANalyzer:SPEaker:VOLume <string>
Options’POT’ | ’OFF’
Where;
•POT means the SPEaker VOLume is controlled via the front panel VOLUME control.
•OFF means the SPEaker VOLume is turned off, independent of the front panel
VOLUME control.
NOTEThis command is not available for the Agilent 8922S.
3-8
4
AF Generator Subsystem
4-1
AF Generator Subsystem
4-2
AF Generator Subsystem
AMPLitude
AMPLitude
DescriptionSets/queries the AF Generator Audio Output AMPLitude, which willbe present atthe front
panel AUDIO OUT connector.
GPIB unit is Volts.
Display units are V and mV.
Default display unit is mV.
SyntaxAFGenerator:AMPLitude?
AFGenerator:AMPLitude <integer [units]> | [:FNUM]
OptionsRefer to Appendix B.
COUPling
DescriptionSelects/queries the AF Generator Audio Output COUPling
SyntaxAFGenerator:COUPling?
AFGenerator:COUPling <string>
Options‘AC’ | ‘DC’
FREQuency
DescriptionSets/queries the AF Generator Audio Output, which will be present at the front panel
AUDIO OUT connector.
Default GPIB unit is HZ.
Default display unit is KHZ.
SyntaxAFGenerator:FREQuency?
AFGenerator:FREQuency <integer [units]> | [:FNUM]
OptionsRefer to Appendix B.
4-3
AF Generator Subsystem
FREQuency
4-4
5
Audio Frequency Commands
(Measure Subsystem)
5-1
Audio Frequency Commands (Measure Subsystem)
5-2
Continued Over
Audio Frequency Commands (Measure Subsystem)
5-3
Audio Frequency Commands (Measure Subsystem)
ACLevel
ACLevel
DescriptionSets the AC Level MEASurement attributes.
GPIB unit is V.
Display units are dBm, V, mV, uV, dBuV, W; default unit is V.
Queries the AC Level MEASurement result for AF Analyzer inputs.
(AFAN:INP) that are in units of AC level.
SyntaxMEASure:AFRequency:ACLevel?
MEASure:AFRequency:ACLevel[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
AM
DescriptionSets the AM Depth MEASurementattributes.Queries the AM Depth MEASurementresult
for AF Analyzer inputs (AFAN:INP) that are units of percent.
GPIB unit is %(PCT).
Display units are %(PCT).
SyntaxMEASure:AFRequency:AM?
MEASure:AFRequency:AM[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
DCAM
DescriptionSets the DC AM Level MEASurement attributes. Queries the DC Level MEASurement
result for AF Analyzer inputs (AFAN:INP) that are units of percent.
GPIB unit is %(PCT).
Display units are %(PCT).
SyntaxMEASure:AFRequency:DCAM?
MEASure:AFRequency:DCAM[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
5-4
Audio Frequency Commands (Measure Subsystem)
DCFM
DCFM
DescriptionSets the DC FM Level MEASurement attributes. Queries the DC Level MEASurement
result for AF Analyzer inputs (AFAN:INP) that are units of Hertz.
GPIB unit is HZ.
Display units are KHZ, HZ; default unit is HZ.
SyntaxMEASure:AFRequency:DCFM?
MEASure:AFRequency:DCFM[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
DCVolts
DescriptionSets the DC VoltsMEASurement attributes.Queries the DC VoltsMEASurement result for
AF Analyzer inputs (AFAN:INP) that are units of DC Volts.
GPIB unit is V.
Display units are dBm, V, mV, uV, dBuV, W; default unit is V.
SyntaxMEASure:AFRequency:DCVolts?
MEASure:AFRequency:DCVolts[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
DISTortion
DescriptionSets the DISTortion MEASurement attributes. Queries the DISTortion MEASurement
result.
GPIB and Display units are dB and percent (PCT).
Default HP-IB and display unit is PCT.
DescriptionSelects/queries the Audio FRequency SELected measurement. NOTE: to get valid
measurements for DC AM, DC FM and DC Volts, this filed must be set to ’DC LEVEL’
and the AF Analyzer Input (AFAN:INP) is set to look at an AM, FM, or voltage source
(respectively).
SyntaxMEASure:AFRequency:SELect?
MEASure:AFRequency:SELect <string>
Options’AF FREQ’ | ’DC LEVEL’ | ’DISTN’ | ’SINAD’
5-6
Audio Frequency Commands (Measure Subsystem)
SINad
DescriptionSets the SINad MEASurement attributes. Queries the SINad MEASurement result.
GPIB and Display units are dB and percent (PCT)
Default GPIB and Display unit is dB
SyntaxMEASure:AFRequency:SINad?
MEASure:AFRequency:SINad[:MM] | [:AVG] | [:MET]
OptionsRefer to Appendices D, F and G.
SINad
5-7
Audio Frequency Commands (Measure Subsystem)
SINad
5-8
6
Bit Error Test Subsystem
6-1
Bit Error Test Subsystem
6-2
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.