Comprehensive Program Example for AT Test (based on TAP test data connection)
Last updated: May 24, 2006
10 !******************************************************************************
20 ! E1966A Comprehensive Programming Example
30 ! Revision: Nov. 22, 2002
40 !
50 ! This program opens an RTAP connection with a 1xEV-DO Access Terminal and
60 ! measures waveform quality, maximum power, minimum power,
70 ! TX spurious emissions, TROLPC, and range of open loop power.
80 ! It then moves to an FTAP connection and measures receiver sensitivity,
90 ! receiver dymanic range, and demodulation of traffic channel in AWGN.
100 !
110 ! The simple test executive allows you to set the test sequence by using gosubs
120 ! to call subroutines for each test.
130 !
140 ! You may un-comment handoffs and test subroutine calls and perform the
150 ! tests at various channels as needed.
160 !******************************************************************************
170 !
180 !***Initialize program variables***
190 !
200 OPTION BASE 1
210 !
220 COM Testset,Result_file$[30] ! Declare common variables
230 COM /File/Openfile_flag
240 ! Results file open flag,
250 ! 1=Open a results file, 0=No results file opened
260 ! Results file is stored under C:\Results\
270 !
280 DIM Pass_fail$[40] ! Declare Pass or Fail indication string
290 DIM Sector_id$[40] ! Declare Sector ID string
300 DIM Awgn_per_data$(18,3)[12]
310 ! Declare array to hold data AWGN PER test
320 !
330 Testset=714
340 ! Set "Testset" to GPIB address of test set
350 !
360 CLEAR SCREEN ! Clear the PC display
370 !
380 !***Set up GPIB timeout***
390 !
400 ON TIMEOUT 7,20 CALL Timeout
410 ! Call "Timeout" routine after 20 seconds of GP-IB hang-up
420 !
430 !**************************************************************************
440 ! STEP 1: SET UP THE TEST SET
450 !**************************************************************************
460 !
470 !***Turn on GPIB debugger. Comment out when done debugging program***
480 !
490 OUTPUT Testset;"SYST:COMM:GPIB:DEB:STAT ON"
500 ! Turn debug state on
510 !
520 !***Set system path loss values. Include cable and coupler losses.***
530 !
540 Loss_frequency$=" 800 MHZ,2000 MHZ"
550 ! Set frequencies for amplitude offset (path loss)
560 Expected_loss$=" -1.5,-1.5"
576 ! Set path loss at frequencies specified
580 !
590 OUTPUT Testset;"SYSTEM:BEEPER:STATE OFF"
600 ! Turn Off System Beeper
610 !
620 !**************************************************************************
630 ! STEP 2: CONFIGURE TEST SET AND ACCESS TERMINAL PARAMETERS
640 !**************************************************************************
650 !
660 !***Variable declarations for call setup. (AT-specific, change as needed)***
670 !
680 Band$="USPCs" ! Set cell band to US PCS
690 Primary_channel=400 ! Set RF channel for access network
700 Country_code=310 ! Set Access Terminal Country Code
710 Subnet_mask=104 ! Set Sector Subnet mask
720 At_max_power$="DBM23" ! Set AT Maximum Power
730 ! (DBM8, DBM13, DBM18, DBM20, DBM23
740 ! DBM27, DBM28, DBM31, DBM33)
750 Init_cell_power=-50
760 ! Set initial cell power for connection setup
770 Current_chan=Primary_channel
780 ! Set the current channel to equal primary channel
790 !
800 !**************************************************************************
810 ! SIMPLE TEST EXECUTIVE
820 !**************************************************************************
830 !
840 !**************************************************************************
850 ! STEP 1: SET UP THE TEST SET
860 !**************************************************************************
870 !
880 GOSUB Preset_test_set
890 ! End any current connection and preset test set
900 GOSUB Set_path_loss
910 ! Set path loss values into test set RF Offset Table
920 !
930 !**************************************************************************
940 ! STEP 2: CONFIGURE TEST SET AND ACCESS TERMINAL PARAMETERS
950 !**************************************************************************
960 !
970 OUTPUT Testset;"CALL:APPLICATION:TAPROTOCOL:LIMITED OFF"
980 ! If you are testing an access terminal with Qualcomm
990 ! DMSS 5500 Release 3.1, you must set Limited TAP to On
1000 !
1010 GOSUB Set_call_parms ! Set up Access Terminal parameters
1020 !
1030 !**************************************************************************
1040 ! STEP 3: SET MEASUREMENT PARAMETERS
1050 !**************************************************************************
1060 !
1070 GOSUB Set_up_meas
1080 ! Set all measurement triggering to single
1090 !
1100 !***Start test time***
1110 !
1120 GOSUB Start_time
1130 !
1140 !**************************************************************************
1150 ! STEP 4: MAKE A CONNECTION (Open a session and open an RTAP connection)
1160 !**************************************************************************
1170 !
1180 GOSUB Session_open
1190 ! Open a session with the AT and read AT parameters
1200 !
1210 !**************************************************************************
1220 !***Open results file***
1230 !
1240 Openfile_flag=1
1250 IF Openfile_flag THEN GOSUB Open_rslts_file
1260 ! Store results in text file, file name= hid+current time
1270 !
1280 !***Print ACCESS TERMINAL information***
1290 !
1300 Print_title("Access Terminal Information:")
1310 PRINT
1320 Print_res_str("Session Seed:",Sseed$)
1330 Print_res_str("Hardware ID Type:",Hid_type$)
1340 Print_res_str("Hardware ID Hex:",Hid_hex$)
1350 Print_res_str("Hardware ID Dec:",Hid_dec$)
1360 Print_title(" ")
1370 !**************************************************************************
1380 !
1390 GOSUB Rtap_connect
1400 ! Open an RTAP connection
1410 !
1420 !***Hand off to first channel to be tested***
1430 !
1440 !Handoff_band$="USPCS"
1450 ! Only specify handoff band when performing interband HO
1460 !Handoff_chan=75
1470 ! Hand off to "low" channel for test
1480 !GOSUB Handoff
1490 ! Hand off to the handoff band and channel specified
1500 !
1510 !**************************************************************************
1520 ! STEP 5: INITIATE AND FETCH TX MEASUREMENTS
1530 !**************************************************************************
1540 !
1550 GOSUB Waveform_qual ! Test waveform quality
1560 GOSUB Max_pow_spur ! Test max power and TX spurious emissions
1570 GOSUB Min_pow ! Test min power
1580 GOSUB Time_resp_olp ! Test time response of open loop power
1590 GOSUB Rng_open_loop ! Test range of open loop output power
1600 !
1610 !**************************************************************************
1620 ! STEP 6: RECONFIGURE TEST SET AND AT PARMS (Change to an FTAP connection)
1630 !**************************************************************************
1640 !
1650 GOSUB Ftap_connect ! Change to an FTAP connection
1660 !
1670 !**************************************************************************
1680 ! STEP 5: INITIATE AND FETCH RX MEASUREMENTS
1690 !**************************************************************************
1700 !
1710 GOSUB Sensitivity ! Test receiver sensitivity
1720 GOSUB Dynamic_range ! Test dynamic range
1730 GOSUB Traf_per_awgn ! Test demod of traffic channel in AWGN
1740 !
1750 !**************************************************************************
1760 ! STEP 6: RECONFIGURE TEST SET AND ACCESS TERMINAL CONNECTION PARAMETERS
1770 ! (Perform a handoff to a new channel and repeat testing as needed)
1780 !**************************************************************************
1790 !
1800 ! GOSUB Rtap_connect ! Move to an RTAP connection
1810 ! Handoff_chan=1023 ! Hand off to "high" channel for test
1820 ! GOSUB Handoff
1830 !
1840 ! GOSUB Waveform_qual
1850 ! GOSUB Max_pow_spur
1860 ! GOSUB Min_pow
1870 ! GOSUB Time_resp_olp
1880 ! GOSUB Rng_open_loop
1890 !
1900 ! GOSUB Ftap_connect ! Move to an FTAP connection
1910 !
1920 ! GOSUB Sensitivity
1930 ! GOSUB Dynamic_range
1940 ! GOSUB Traf_per_awgn
1950 !
1960 ! GOSUB Rtap_connect ! Move to an RTAP connection
1970 ! Handoff_chan=799 ! Hand off to "medium" channel for test
1980 ! GOSUB Handoff
1990 !
2000 ! GOSUB Waveform_qual
2010 ! GOSUB Max_pow_spur
2020 ! GOSUB Min_pow
2030 ! GOSUB Time_resp_olp
2040 ! GOSUB Rng_open_loop
2050 !
2060 ! GOSUB Ftap_connect ! Move to an FTAP connection
2070 !
2080 ! GOSUB Sensitivity
2090 ! GOSUB Dynamic_range
2100 ! GOSUB Traf_per_awgn
2110 !
2120 !**************************************************************************
2130 ! STEP 7: END THE CONNECTION
2140 !**************************************************************************
2150 !
2160 End_exec:!
2170 GOSUB End_connection ! End the current connection
2180 GOSUB End_time ! Stop test time
2190 GOTO End_program
2200 ! Jump to end of program. Do not remove this line.
2210 ! Must jump over the sub-routines to the end.
2220 !
2230 !**************************************************************************
2240 !
2250 !**************************************************************************
2260 ! BEGINNING OF SUBROUTINES
2270 !**************************************************************************
2280 !
2290 Preset_test_set:!
2300 !*******************************************************************
2310 ! Subroutine: Preset the test set (Step 1: Set Up the Test Set)
2320 !*******************************************************************
2330 !
2340 OUTPUT Testset;"*RST"
2350 ! Full preset test set
2360 OUTPUT Testset;"*OPC?"
2370 ENTER Testset;Opc$
2380 RETURN
2390 !
2400 Set_path_loss:!
2410 !*******************************************************************
2420 ! Subroutine: Set path loss values (Step 1: Set Up the Test Set)
2430 !*******************************************************************
2440 !
2450 OUTPUT Testset;"SYST:CORR:FREQ";Loss_frequency$
2460 ! Set the frequencies for amplitude offset
2470 OUTPUT Testset;"SYST:CORR";Expected_loss$
2480 ! Set the amplitude offsets for above frequencies
2490 RETURN
2500 !
2510 Set_call_parms:!
2520 !*******************************************************************
2530 ! Subroutine: Step 2: Configure Test Set and Access Terminal Parameters
2540 !*******************************************************************
2550 !
2560 DISP "Setting up Test Set and Access Terminal Parameters"
2570 !
2580 OUTPUT Testset;"CALL:BAND ";Band$
2590 ! Set Cell Band
2600 OUTPUT Testset;"CALL:CHAN ";Primary_channel
2610 ! Set RF Channel for selected Cell Band
2620 OUTPUT Testset;"CALL:POW ";Init_cell_power
2630 ! Set and turns on Cell Power for connection
2640 OUTPUT Testset;"CALL:MS:POWER:MAXIMUM "&At_max_power$
2650 ! Set AT maximum expected power
2660 OUTPUT Testset;"CALL:MCCODE ";Country_code
2670 ! Set AT country code specified
2680 OUTPUT Testset;"CALL:PARAMETER:SECTOR:SMASK ";Subnet_mask
2690 ! Set MS subnet mask specified
2700 RETURN
2710 !
2720 Set_up_meas:!
2730 !*******************************************************************
2740 ! Subroutine: Set all measurement triggers to single
2750 ! (Step 3: Set Meas Parms)
2760 !*******************************************************************
2770 !
2780 OUTPUT Testset;"SETUP:CONTINUOUS:OFF"
2790 ! Set all measurements to single trigger
2800 RETURN
2810 !
2820 Session_open:!
2830 !*******************************************************************
2840 ! Subroutine: Open session
2850 !*******************************************************************
2860 !
2870 OUTPUT Testset;"CALL:DCONNECTED:TIMEOUT 30"
2880 ! Set connection change detector timeout
2890 OUTPUT Testset;"CALL:DCONNECTED:ARM"
2900 ! Arm the connection state change detector
2910 !
2920 BEEP
2930 LINPUT "Connect AT and power on, press ENTER when session open",Keyboard$
2940 DISP "Verifying session is open"
2950 !
2960 OUTPUT Testset;"CALL:SOPEN?"
2970 ! Query the session open state
2980 ENTER Testset;Session_open
2990 IF Session_open=0 THEN
3000 ! If session did not open then end program
3010 BEEP
3020 Print_title("Access Terminal did not open session, check settings")
3030 Print_title("Terminating Testing")
3040 GOTO End_program
3050 END IF
3060 !
3070 DISP "Session Open"
3080 !
3090 !***Read ACCESS TERMINAL information***
3100 !
3110 OUTPUT Testset;"CALL:MS:REP:SSEED?"
3120 ENTER Testset;Sseed$
3130 OUTPUT Testset;"CALL:MS:REP:HID:TYPE?"
3140 ENTER Testset;Hid_type$
3150 OUTPUT Testset;"CALL:MS:REP:HID:HEX?"
3160 ENTER Testset;Hid_hex$
3170 OUTPUT Testset;"CALL:MS:REP:HID:DEC?"
3180 ENTER Testset;Hid_dec$
3190 !
3200 RETURN
3210 !
3220 Rtap_connect:!
3230 !*******************************************************************
3240 ! Subroutine: Open an RTAP connection
3250 !*******************************************************************
3260 !
3270 DISP "Opening (or Moving to) an RTAP Connection"
3280 !
3290 IF NOT FNConnected THEN
3300 DISP "Connection is not currently open"
3310 ! If the state is NOT connected, then see if it is session open
3320 !
3330 IF NOT FNSession_check THEN
3340 ! If the state is NOT session open, then end program
3350 Print_title("Session is not currently open")
3360 Print_title("Ending Testing")
3370 GOTO End_program
3380 END IF
3390 ! If the state is session open, then change to RTAP and
3400 ! open a connection
3410 DISP "Session is open, opening an RTAP connection now"
3420 !
3430 OUTPUT Testset;"CALL:APPLICATION RTAP"
3440 ! Set application type to RTAP (for TX testing)
3450 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS9600"
3460 ! Set RTAP data rate to 9600 kbps
3470 GOSUB Start_data
3480 !
3490 ELSE
3500 DISP "Connection is currently open, changing to RTAP"
3510 ! If state is connected, then change to RTAP
3520 OUTPUT Testset;"CALL:APPLICATION RTAP"
3530 ! Set application type to RTAP (for TX testing)
3540 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS9600"
3550 ! Set RTAP data rate to 9600 kbps
3560 !
3570 IF NOT FNConnected THEN
3580 ! This additional loop is only necessary if Limited TAP is On
3590 DISP "Connection was closed when Application changed"
3600 ! If the state is NOT connected, then see if session open
3610 IF NOT FNSession_check THEN
3620 ! If the state is NOT session open, then end program
3630 Print_title("Session is not currently open")
3640 Print_title("Ending Testing")
3650 GOTO End_program
3660 END IF
3670 ! If the state is session open, then re-open a connection
3680 DISP "Session is open, re-opening an RTAP connection now"
3690 GOSUB Start_data
3700 END IF
3710 !
3720 DISP "RTAP Connection Open"
3730 !
3740 END IF
3750 !
3760 RETURN
3770 !
3780 Ftap_connect:!
3790 !*******************************************************************
3800 ! Subroutine: Open an FTAP connection
3810 !*******************************************************************
3820 !
3830 DISP "Opening (or Moving to) an FTAP Connection"
3840 !
3850 IF NOT FNConnected THEN
3860 DISP "Connection is not currently open"
3870 ! If the state is NOT connected, then see if it is session open
3880 !
3890 IF NOT FNSession_check THEN
3900 ! If the state is NOT session open, then end program
3910 Print_title("Session is not currently open")
3920 Print_title("Ending Testing")
3930 GOTO End_program
3940 END IF
3950 ! If the state is session open, then change to FTAP and
3960 ! open a connection
3970 DISP "Session is open, opening an FTAP connection now"
3980 !
3990 OUTPUT Testset;"CALL:APPLICATION FTAP"
4000 ! Set application type to FTAP (for RX testing)
4010 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE S02B307200"
4020 ! Set FTAP data rate to 2-slot 307.2 kbps
4030 GOSUB Start_data
4040 !
4050 ELSE
4060 DISP "Connection is currently open, changing to FTAP"
4070 ! If state is connected, then change to FTAP
4080 OUTPUT Testset;"CALL:APPLICATION FTAP"
4090 ! Set application type to FTAP (for RX testing)
4100 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE S02B307200"
4110 ! Set FTAP data rate to 2-slot 307.2 kbps
4120 !
4130 IF NOT FNConnected THEN
4140 DISP "Connection was closed when Application changed"
4150 ! If the state is NOT connected, then see if session open
4160 IF NOT FNSession_check THEN
4170 ! If the state is NOT session open, then end program
4180 Print_title("Session is not currently open")
4190 Print_title("Ending Testing")
4200 GOTO End_program
4210 END IF
4220 ! If the state is session open, then re-open a connection
4230 DISP "Session is open, re-opening an FTAP connection now"
4240 GOSUB Start_data
4250 END IF
4260 !
4270 DISP "FTAP Connection Open"
4280 !
4290 END IF
4300 !
4310 RETURN
4320 !
4330 Start_data:!
4340 !*******************************************************************
4350 ! Subroutine: Start data connection and verify it has connected
4360 !*******************************************************************
4370 !
4380 OUTPUT Testset;"CALL:DCONNECTED:TIMEOUT 10"
4390 ! Set connection change detector timeout
4400 OUTPUT Testset;"CALL:DCONNECTED:ARM"
4410 ! Arm the connection state change detector
4420 OUTPUT Testset;"CALL:FUNCTION:DATA:START"
4430 ! Page the access terminal
4440 OUTPUT Testset;"CALL:DCONNECTED?"
4450 ! Query the connection status
4460 ENTER Testset;Data_started
4470 !
4480 IF Data_started=0 THEN
4490 Print_title("Data connection could not be opened")
4500 Print_title("Ending Testing")
4510 GOTO End_program
4520 END IF
4530 !
4540 DISP "Data Connection Open"
4550 !
4560 RETURN
4570 !
4580 Handoff:!
4590 !*******************************************************************
4600 ! Subroutine: Set up and perform a hard handoff
4610 !*******************************************************************
4620 !
4630 !***Set up a hard handoff***
4640 !
4650 OUTPUT Testset;"CALL:SETUP:BAND "&Handoff_band$
4660 ! Specify the cell band to hand off to
4670 OUTPUT Testset;"CALL:SETUP:CHANNEL ";Handoff_chan
4680 ! Specify the channel number to hand off to
4690 !
4700 !***Perform a hard handoff***
4710 !
4720 OUTPUT Testset;"CALL:HANDOFF"
4730 ! Initiate a hard handoff
4740 !
4750 IF NOT FNConnected THEN
4760 ! Verify connection is still open after handoff
4770 DISP "Handoff attempt failed, program stopped"
4780 GOTO End_program
4790 ELSE
4800 PRINT
4810 Print_results("Handoff completed to channel: ",Handoff_chan,"")
4820 PRINT "Call connected"
4830 PRINT
4840 Current_chan=Handoff_chan
4850 Band$=Handoff_band$
4860 !
4870 END IF
4880 !
4890 RETURN
4900 !
4910 Waveform_qual:!
4920 !*******************************************************************
4930 ! Subroutine: Waveform Quality + Code Domain Measurement
4940 ! 4.2.2 Waveform Quality and Frequency Accuracy
4950 !*******************************************************************
4960 !
4970 DISP "Measuring Waveform Quality"
4980 !
4990 !***Set up test parameters***
5000 !
5010 Ior=-75 ! Cell power for test
5020 !
5030 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS9600"
5040 ! Set RTAP data rate to 9600
5050 OUTPUT Testset;"CALL:POW ";Ior
5060 ! Set cell power
5070 !
5080 !***Set up measurement parameters***
5090 !
5100 OUTPUT Testset;"SETUP:DOWQ:TIMEOUT 10"
5110 ! Set waveform quality measurement timeout to 10 seconds
5120 OUTPUT Testset;"SETUP:DOWQ:SLOT:COUNT 1"
5130 ! Set slots to measure to 1
5140 !
5150 !***INITiate and FETCh measurement results***
5160 !
5170 OUTPUT Testset;"INITIATE:DOWQUALITY"
5180 ! Initiate a waveform quality + code domain measurement
5190 OUTPUT Testset;"FETCh:DOWQUALITY?"
5200 ! Query the test set for waveform quality measurement results
5210 ENTER Testset;Integrity,Rho,F_err,T_err,C_feed,P_err,M_err,Evm
5220 !
5230 !***Print Waveform Quality results***
5240 !
5250 Print_title("Waveform Quality Test Results:")
5260 PRINT
5270 Print_results("Channel= ",Current_chan,"")
5280 Print_results("Integrity indicator = ",Integrity,"")
5290 Print_results("Rho = ",Rho,"")
5300 Print_results("Frequency error = ",F_err,"Hz")
5310 Print_results("Time error = ",T_err,"us")
5320 Print_results("Carrier feedthrough = ",C_feed,"dBc")
5330 Print_results("Phase error = ",P_err,"deg")
5340 Print_results("Magnitude error = ",M_err,"%")
5350 Print_results("Error vector magnitude = ",Evm,"%")
5360 PRINT
5370 Print_title("Waveform Quality Test Complete")
5380 PRINT
5390 PRINT
5400 !
5410 !***Post test clean up***
5420 !
5430 OUTPUT Testset;"INIT:DOWQ:OFF"
5440 OUTPUT Testset;"CALL:POW ";Init_cell_power
5450 ! Set cell power back to initial level
5460 DISP ""
5470 !
5480 RETURN
5490 !
5500 Max_pow_spur:!
5510 !*******************************************************************
5520 ! Subroutine: Digital Average Power and
5530 ! TX Spurious Emissions Measurements
5540 ! 4.3.4 Maximum RF Output Power
5550 ! 4.4.1 Conducted Spurious Emissions
5560 !*******************************************************************
5570 !
5580 DISP "Measuring Maximum Power and TX Spurious Emissions"
5590 !
5600 !***Set up test parameters***
5610 !
5620 Ior=-60 ! Set cell power for test
5630 !
5640 IF Band$="KPCS" OR Band$="USPCS" OR Band$="USPCs1900" OR Band$="IMT2000" THEN
5650 ! Set open loop adjust for test
5660 Ol_adjust=84
5670 ELSE
5680 Ol_adjust=81
5690 END IF
5700 !
5710 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS153600"
5711 ! Set RTAP data rate to 153600
5715 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE S02BPS307200"
5716 ! Set FTAP data rate to 307.2kbps (2 slots).
5720 OUTPUT Testset;"CALL:APPLICATION:ACKChannel:BFMAttribute 1"
5721 ! Set ACK channel bit fixed mode attribute to On.
5730 OUTPUT Testset;"CALL:APAR:POWER:OLADJUST ";Ol_adjust
5740 ! Set Open Loop Adjust
5750 OUTPUT Testset;"CALL:APAR:PROBE:IADJUST 15"
5760 ! Set Probe Initial Adjust
5850 OUTPUT Testset;"CALL:APAR:PROBE:POWER:STEP 7.5"
5860 ! Set Probe Step
5870 !
5880 !***Set up measurement parameters***
5890 !
5900 OUTPUT Testset;"SETUP:DAPOWER:TIMEOUT 1"
5910 ! Set DIGITAL Power timeout to 1 sec
5920 OUTPUT Testset;"SETUP:CTXS:TIMEOUT 5"
5930 ! Set TX Spur Emissions timeout to 5 sec
5940 !
5950 !***Set test conditions***
5960 !
5970 OUTPUT Testset;"CALL:POW ";Ior
5980 ! Set Cell Power for Test
5990 OUTPUT Testset;"CALL:CLPCONTROL:REVERSE:MODE UP"
6000 ! Start transmission of All Up (0) power control bits
6010 WAIT 1
6020 ! Settling time to allow mobile power to slew up to maximum power
6030 !
6040 !***Obtain measurement results***
6050 !
6060 OUTPUT Testset;"INITIATE:DAPOWER;CTXS"
6070 ! Initiate digital average power and
6080 ! TX spurious emissions measurements
6090 !
6100 LOOP
6110 OUTPUT Testset;"INIT:DONE?"
6120 ! Determine if a measurement is done
6130 ENTER Testset;Meas_done$
6140 ! Obtain measurement results as they are ready
6150 !
6160 SELECT Meas_done$
6170 CASE "DAP"
6180 OUTPUT Testset;"FETCh:DAPOWER?"
6190 ENTER Testset;Integrity,Avg_power_dbm
6200 CASE "CTXS"
6210 OUTPUT Testset;"FETCH:CTXS?"
6220 ENTER Testset;Ctxs_integ,Ctxs_pf,Low_adj,Upp_adj,Low_alt,Upp_alt
6230 END SELECT
6240 !
6250 EXIT IF Meas_done$="NONE"
6260 ! Exit loop when all measurements are complete
6270 END LOOP
6280 ! If Meas_done$="WAIT" then loop continues until "NONE"
6290 !
6300 Avg_power_dbw=Avg_power_dbm-30
6310 ! Convert dBm to dBW
6320 !
6330 SELECT Ctxs_pf
6340 ! Assign CTXS pass/fail results to a string
6350 CASE 0
6360 Pass_fail$="PASS"
6370 CASE 1
6380 Pass_fail$="FAIL"
6390 END SELECT
6400 !
6410 !***Print Max Power Test Results***
6420 !
6430 Print_title("Max Power Test Results:")
6440 PRINT
6450 Print_results("Channel= ",Current_chan,"")
6460 Print_results("Integrity indicator = ",Integrity,"")
6470 Print_results("Maximum Power dBm:",Avg_power_dbm,"dBm")
6480 Print_results("Maximum Power dBW:",Avg_power_dbw,"dBW")
6490 PRINT
6500 Print_title("Max Power Test Complete")
6510 PRINT
6520 PRINT
6530 !
6540 !***Print TX Spurious Test Results
6550 !
6560 Print_title("TX Spurious Test Results:")
6570 PRINT
6580 Print_results("Channel= ",Current_chan,"")
6590 Print_results("Integrity indicator = ",Ctxs_integ,"")
6600 Print_res_str("Test Result: ",Pass_fail$)
6610 Print_results("Lower Adjacent Power",Low_adj,"dBc")
6620 Print_results("Upper Adjacent Power",Upp_adj,"dBc")
6630 Print_results("Lower Alternate Power",Low_alt,"dBc")
6640 Print_results("Upper Alternate Power",Upp_alt,"dBc")
6650 PRINT
6660 Print_title("TX Spurious Test Complete")
6670 PRINT
6680 PRINT
6690 !
6700 !***Post test clean up***
6710 !
6720 OUTPUT Testset;"CALL:CLPCONTROL:REVERSE:MODE ACTIVE"
6730 ! Return to active power control bits
6740 OUTPUT Testset;"CALL:POW ";Init_cell_power
6750 ! Set cell power back to initial level
6760 ! Do this before reconfiguring other parms
6770 OUTPUT Testset;"CALL:APAR:PROBE:IADJUST 0"
6780 ! Set Access parameters for test
6790 OUTPUT Testset;"CALL:APAR:PROBE:STEP:COUNT 5"
6800 ! Set Access paramters for test
6840 OUTPUT Testset;"CALL:APAR:PROBE:POWER:STEP 1"
6850 ! Set Access paramters for test
6860 OUTPUT Testset;"INIT:DAP:OFF"
6870 ! Turn digital ave power off
6880 OUTPUT Testset;"INIT:CTXS:OFF"
6890 ! Turn TX spurious emissions off
6900 DISP ""
6910 !
6920 RETURN
6930 !
6940 Min_pow:!
6950 !*******************************************************************
6960 ! Subroutine: Channel Power Measurement
6970 ! 4.3.5 Minimum Controlled Output Power
6980 !*******************************************************************
6990 !
7000 DISP "Measuring Minimum Power"
7010 !
7020 !***Set up test parameters***
7030 !
7040 Ior=-25
7050 !
7060 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS9600"
7070 ! Set RTAP data rate to 9600
7080 OUTPUT Testset;"CALL:CONNECTED:DROP:TIMER:STATE 0"
7090 ! Turn the call drop timer off
7100 !
7110 !***Set up measurement parameters***
7120 !
7130 OUTPUT Testset;"SETUP:CPOWER:TIMEOUT .5"
7140 ! Set Channel Power timeout to 0.5 sec
7150 !
7160 !***Set test conditions***
7170 !
7180 OUTPUT Testset;"CALL:POW ";Ior
7190 ! Set cell power for test
7200 OUTPUT Testset;"CALL:CLPCONTROL:REVERSE:MODE DOWN"
7210 ! Start transmission of All Down (1) power control bits
7220 WAIT 1
7230 ! Settling time for mobile output power to slew down
7240 !
7250 !***INITiate and FETCh measurements***
7260 !
7270 GOSUB Meas_chan_pow
7280 ! Subroutine for measuring channel power, includes ranging
7290 !
7300 !***Print measurement results***
7310 !
7320 Print_title("Minimum Power Test Results:")
7330 PRINT
7340 Print_results("Channel= ",Current_chan,"")
7350 Print_results("Integrity indicator = ",Integrity,"")
7360 Print_results("Minimum Power dBm:",Channel_power,"dBm/1.23 MHz")
7370 PRINT
7380 Print_title("Minimum Power Test Complete")
7390 PRINT
7400 PRINT
7410 !
7420 !***Post test clean up***
7430 !
7440 OUTPUT Testset;"CALL:CLPCONTROL:REVERSE:MODE ACTIVE"
7450 ! Return to active power control bits
7460 OUTPUT Testset;"CALL:POW ";Init_cell_power
7470 ! Set cell power back to initial level
7480 OUTPUT Testset;"CALL:CONNECTED:DROP:TIMER:STATE 1"
7490 ! Return call drop timer to ON
7500 OUTPUT Testset;"INIT:CPOW:OFF"
7510 ! Turn channel power off
7520 DISP ""
7530 !
7540 RETURN
7550 !
7560 Rng_open_loop:!
7570 !*******************************************************************
7580 ! Subroutine: Access Probe Power Measurement
7590 ! 4.3.1 Range of Open Loop Output Power
7600 !*******************************************************************
7610 !
7620 DISP "Testing Range of Open Loop Power"
7630 !
7640 !***End current connection***
7650 !
7660 IF FNConnected THEN
7670 ! Check to see if currently connected
7680 GOSUB End_connection
7690 END IF
7700 !
7710 !***Verify session is open***
7720 !
7730 IF NOT FNSession_check THEN
7740 ! Check to see if session open
7750 Print_title("Session must be open during Range of Open Loop")
7760 Print_title("Ending Testing")
7770 GOTO End_program
7780 END IF
7790 !
7800 !***Set up test parameters***
7810 !
7820 Ior1=-25 ! First level for test
7830 Ior2=-65 ! Second level for test
7840 Ior3=-93.5
7850 ! Ior for test 3 Band Class 0, AT Class III
7860 Ol_adjust=78
7870 ! Set Open Loop Adjust for Band Class 0
7880 !
7890 OUTPUT Testset;"CALL:APAR:POWER:OLADJUST ";Ol_adjust
7900 ! Set Open Loop Adjust
7910 OUTPUT Testset;"CALL:APAR:PREAMBLE:LENGTH 7"
7920 ! Set preamble length in frames
7970 OUTPUT Testset;"CALL:APAR:PROBE:SEQUENCE 1"
7980 ! Set Probe Sequence Max
7990 ! This must be done BEFORE call limit mode is turned on
8000 OUTPUT Testset;"CALL:APAR:PROBE:POWER:STEP 0"
8010 ! Set Probe Power Step
8020 !
8030 !***Set up measurement parameters***
8040 !
8050 OUTPUT Testset;"SETUP:CAPP:TIMEOUT 10"
8060 ! Set access probe power timeout to 10 seconds
8070 !
8080 !***Set test conditions***
8090 !
8100 OUTPUT Testset;"CALL:CONNECTED:LIMIT:STATE 1"
8110 ! Turn on call limit mode so connection is not established
8120 ! This must be done AFTER probe sequence max is set
8130 !
8140 !***Obtain measurement results***
8150 !
8160 OUTPUT Testset;"CALL:POW ";Ior1
8170 ! Set cell power for test 1
8180 WAIT .1
8190 ! Settling time for access terminal output power to slew
8200 OUTPUT Testset;"CALL:FUNCTION:DATA:START"
8210 ! Page access terminal
8220 OUTPUT Testset;"READ:CAPP?"
8230 ! Read access probe power
8240 ENTER Testset;Integrity1,Test1
8250 OUTPUT Testset;"CALL:FUNCTION:DATA:STOP"
8260 ! Stop data connection paging before repaging at next level
8270 !
8280 OUTPUT Testset;"CALL:POW ";Ior2
8290 ! Set cell power for test 2
8300 WAIT .1
8310 ! Settling time for mobile output power to slew
8320 OUTPUT Testset;"CALL:FUNCTION:DATA:START"
8330 ! Page access terminal
8340 OUTPUT Testset;"READ:CAPP?"
8350 ! Read access probe power
8360 ENTER Testset;Integrity2,Test2
8370 OUTPUT Testset;"CALL:FUNCTION:DATA:STOP"
8380 ! Stop data connection paging before repaging at next level
8390 !
8400 OUTPUT Testset;"CALL:POW ";Ior3
8410 ! Set cell power for test 3
8420 WAIT .1
8430 ! Settling time for mobile output power to slew
8440 OUTPUT Testset;"CALL:FUNCTION:DATA:START"
8450 ! Page access terminal
8460 OUTPUT Testset;"READ:CAPP?"
8470 ! Read access probe power
8480 ENTER Testset;Integrity3,Test3
8490 OUTPUT Testset;"CALL:FUNCTION:DATA:STOP"
8500 ! Stop data connection paging
8510 !
8520 !***Print measurement results***
8530 !
8540 Print_title("Range of Open Loop Power Control Results:")
8550 PRINT
8560 Print_results("Channel= ",Current_chan,"")
8570 Print_results("Integrity indicator = ",Integrity1,"")
8580 Print_results("Test 1 @ "&VAL$(Ior1)&" dBm:",Test1,"dBm/1.23 MHz")
8590 Print_results("Integrity indicator = ",Integrity2,"")
8600 Print_results("Test 2 @ "&VAL$(Ior2)&" dBm:",Test2,"dBm/1.23 MHz")
8610 Print_results("Integrity indicator = ",Integrity1,"")
8620 Print_results("Test 3 @ "&VAL$(Ior3)&" dBm:",Test3,"dBm/1.23 MHz")
8630 PRINT
8640 Print_title("Range of Open Loop Power Test Complete")
8650 PRINT
8660 PRINT
8670 !
8680 !***Post test clean up***
8690 !
8700 OUTPUT Testset;"CALL:CONNECTED:LIMIT:STATE 0"
8710 ! Turn off call limit mode
8720 ! Must do BEFORE can change probe max sequence
8721 WAIT .5
8730 OUTPUT Testset;"CALL:POW ";Init_cell_power
8740 ! Set Cell Power to default
8750 ! Do this before reconfiguring other parms so signaling
8760 ! is successful (don't want cell power too low for signaling)
8770 OUTPUT Testset;"CALL:APAR:PREAMBLE:LENGTH 7"
8780 ! Set preamble length in frames
8790 OUTPUT Testset;"CALL:APAR:PROBE:IADJUST 0"
8800 ! Set Probe Initial Adjust
8810 OUTPUT Testset;"CALL:APAR:PROBE:STEP:COUNT 3"
8820 ! Set Probe Num Steps
8850 OUTPUT Testset;"CALL:APAR:PROBE:POWER:STEP 3"
8860 ! Set Probe Step
8861 !OUTPUT Testset;"CALL:APAR:PROBE:SEQUENCE 1"
8862 ! Set Probe Sequence Max.It requires session negotiation.
8863 !WAIT 20
8880 OUTPUT Testset;"INIT:CAPP:OFF"
8890 ! Set access probe power meas off
8900 DISP ""
8910 !
8920 RETURN
8930 !
8940 Time_resp_olp:!
8950 !*******************************************************************
8960 ! Subroutine: Time Response of Open Loop Power Control Measurement
8970 ! 4.3.2 Time Response of Open Loop Power Control
8980 !*******************************************************************
8990 !
9000 DISP "Testing Time Response of Open Loop Power Control"
9010 !
9020 !***Set up test parameters***
9030 !
9040 Ior=-60 ! Start Level for test
9050 !
9060 !***Set up measurement parameters***
9070 !
9080 OUTPUT Testset;"SETUP:TROP:TIMEOUT 5"
9090 ! Set TROLPC measurement timeout to 5 s
9100 !
9110 !***Set test conditions***
9120 !
9130 OUTPUT Testset;"CALL:APPLICATION:RTAP:DRATE BPS9600"
9140 ! Set RTAP data rate 9.6 kbps
9150 OUTPUT Testset;"CALL:APPLICATION:ACKCHANNEL:BFMATTRIBUTE OFF"
9160 ! Turn off ACK Channel Bit Fixed Mode Attribute
9170 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 0"
9180 ! Set AT Directed Packets to 0 to disable R-ACK Channel
9190 OUTPUT Testset;"CALL:POW ";Ior
9200 ! Set cell power for Test
9210 WAIT .1
9220 ! Open Loop Time Response settling time after cell power change
9230 !
9240 Print_title("Time Response of Open Loop Power Test Results:")
9250 FOR J=1 TO 4
9260 ! Loop to measure power after 4 step changes in cell power
9270 SELECT J
9280 ! Set step direction for each measurement
9290 CASE 1
9300 Test_number=J
9310 Step$="UP20"
9320 CASE 2
9330 Test_number=J
9340 Step$="DOWN20"
9350 CASE 3
9360 Test_number=J
9370 Step$="DOWN20"
9380 CASE 4
9390 Test_number=J
9400 Step$="UP20"
9410 END SELECT
9420 !
9430 !***Obtain measurement results***
9440 !
9450 OUTPUT Testset;"SETUP:TROP:STEP "&Step$
9460 ! Set step direction for measurement
9470 OUTPUT Testset;"READ:TROP?"
9480 ! Initiate Time Response of Open Loop measurement,
9490 ! which automatically induces step change in direction
9500 ! set by SETUP:TROP:STEP, then fetch results
9510 ENTER Testset;Integrity,Pass_fail
9520 !
9530 SELECT Pass_fail
9540 ! Assign pass/fail results to a string
9550 CASE 0
9560 Pass_fail$="PASS"
9570 CASE 1
9580 Pass_fail$="FAIL"
9590 CASE ELSE
9600 Pass_fail$="ERROR"
9610 END SELECT
9620 !
9630 !***Print measurement results***
9640 !
9650 PRINT
9660 Print_title("Test Number "&VAL$(Test_number))
9670 Print_results("Channel= ",Current_chan,"")
9680 Print_results("Integrity indicator = ",Integrity,"")
9690 Print_res_str("Test Result:",Pass_fail$)
9700 !
9710 NEXT J
9720 !
9730 PRINT
9740 Print_title("Time Response of Open Loop Power Test Complete")
9750 PRINT
9760 PRINT
9770 !
9780 !***Post test clean up***
9790 !
9800 OUTPUT Testset;"INIT:TROP:OFF"
9810 ! Turn off measurement
9820 OUTPUT Testset;"CALL:APPLICATION:ACKCHANNEL:BFMATTRIBUTE ON"
9830 ! Turn ACK Channel Bit Fixed Mode Attribute back on
9840 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 50"
9850 ! Set AT Directed Packets back to default value of 50%
9860 OUTPUT Testset;"CALL:POW ";Init_cell_power
9870 ! Set cell power back to initial level
9880 DISP ""
9890 !
9900 RETURN
9910 !
9920 Sensitivity:!
9930 !*******************************************************************
9940 ! Subroutine: Packet Error Rate Measurement
9950 ! 3.3.1 Receiver Sensitivity
9960 !*******************************************************************
9970 !
9980 DISP "Testing Receiver Sensitivity"
9990 !
10000 !***Set up test parameters***
10010 !
10020 Ior=-105.5 ! Level for sensitivity test
10030 !
10040 !***Set up measurement parameters***
10050 !
10060 Max_packets=10000 ! Maximum packets
10065 Conf_limit=95 ! 95% confidence limit
10070 Per_limit=.5 ! 0.5% per requirement
10080 !
10090 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
10095 ! Set MAXIMUM PACKETS FOR TEST
10100 OUTPUT Testset;"SETUP:CPERROR:CONF ";Conf_limit
10105 ! Set Confidence level
10110 OUTPUT Testset;"SETUP:CPERROR:CONF:REQ ";Per_limit
10120 ! Set PER Requirement
10130 OUTPUT Testset;"SETUP:CPERROR:TIMEOUT 10"
10140 ! Set PER measurement timeout to 10 s
10150 !
10160 !***Set test conditions***
10170 !
10180 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 50"
10190 ! Set AT Directed Packets to 50%
10200 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE S02B307200"
10210 ! Set FTAP data rate to 2 slot 307.2 kbps
10220 OUTPUT Testset;"CALL:POW ";Ior
10230 ! Set Cell Power for Test
10240 WAIT .5
10250 ! Settling time for access terminal power to slew
10260 !
10270 !***Obtain measurement results***
10280 !
10290 OUTPUT Testset;"INITIATE:CPERROR"
10300 ! Initiate a packet error rate measurement
10310 DISP "Measuring PER"
10320 OUTPUT Testset;"FETCh:CPERROR?"
10330 ! Query the test set for packet error rate measurement results
10340 ENTER Testset;Integrity,Per_test,Per_ratio,Per_count,Packets_tested
10350 !
10360 SELECT Per_test
10370 ! Assign pass/fail results to a string
10380 CASE 0
10390 Pass_fail$="PASS"
10400 CASE 1
10410 Pass_fail$="FAIL"
10420 CASE 2
10430 Pass_fail$="MAX PACKETS"
10440 CASE 3
10450 Pass_fail$="UNKNOWN"
10460 END SELECT
10470 !
10480 !***Print measurement results***
10490 !
10500 Print_title("Sensitivity Packet Error Rate Test Results:")
10510 PRINT
10520 Print_results("Channel= ",Current_chan,"")
10530 Print_results("Integrity indicator = ",Integrity,"")
10540 Print_res_str("PER Test Results",Pass_fail$)
10550 Print_results("PER Ratio",Per_ratio,"%")
10560 Print_results("PER Errors Count",Per_count,"packets")
10570 Print_results("Packets Tested",Packets_tested,"")
10580 PRINT
10590 Print_title("Sensitivity PER Test Complete")
10600 PRINT
10610 PRINT
10620 !
10630 !***Post test clean up***
10640 !
10650 OUTPUT Testset;"INIT:CPER:OFF"
10660 ! Turn off PER measurement
10670 OUTPUT Testset;"CALL:POW ";Init_cell_power
10680 ! Set cell power back to normal level
10690 DISP ""
10700 !
10710 RETURN
10720 !
10730 Dynamic_range:!
10740 !*******************************************************************
10750 ! Subroutine: Packet Error Rate Measurement
10760 ! 3.3.1 Dynamic Range
10770 !*******************************************************************
10780 !
10790 DISP "Testing Dynamic Range"
10800 !
10810 !***Set up test parameters***
10820 !
10830 Ior=-25 ! Level for dynamic range test
10840 !
10850 !***Set up measurement parameters***
10860 !
10870 Max_packets=10000 ! Maximum packets
10880 Conf_limit=.5 ! 0.5% confidence limit
10890 !
10900 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
10910 ! Set MAXIMUM PACKETS FOR TEST
10920 OUTPUT Testset;"SETUP:CPERROR:CONF:REQ ";Conf_limit
10930 ! Set CONFIDENCE LIMIT
10940 OUTPUT Testset;"SETUP:CPERROR:TIMEOUT 10"
10950 ! Set PER measurement timeout to 10 s
10960 !
10970 !***Set test conditions***
10980 !
10990 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 50"
11000 ! Set AT Directed Packets to 50%
11010 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE S01K2458"
11020 ! Set FTAP data rate to 1 slot 2457.8 kbps
11030 OUTPUT Testset;"CALL:POW ";Ior
11040 ! Set Cell Power for Test
11050 WAIT .5
11060 ! Settling time for access terminal power to slew
11070 !
11080 !***Obtain measurement results***
11090 !
11100 OUTPUT Testset;"INITIATE:CPERROR"
11110 ! Initiate a packet error rate measurement
11120 DISP "Measuring PER"
11130 OUTPUT Testset;"FETCh:CPERROR?"
11140 ! Query the test set for packet error rate measurement results
11150 ENTER Testset;Integrity,Per_test,Per_ratio,Per_count,Packets_tested
11160 !
11170 SELECT Per_test
11180 ! Assign pass/fail results to a string
11190 CASE 0
11200 Pass_fail$="PASS"
11210 CASE 1
11220 Pass_fail$="FAIL"
11230 CASE 2
11240 Pass_fail$="MAX PACKETS"
11250 CASE 3
11260 Pass_fail$="UNKNOWN"
11270 END SELECT
11280 !
11290 !***Print measurement results***
11300 !
11310 Print_title("Dynamic Range Packet Error Rate Test Results:")
11320 PRINT
11330 Print_results("Channel= ",Current_chan,"")
11340 Print_results("Integrity indicator = ",Integrity,"")
11350 Print_res_str("PER Test Results",Pass_fail$)
11360 Print_results("PER Ratio",Per_ratio,"%")
11370 Print_results("PER Errors Count",Per_count,"packets")
11380 Print_results("Packets Tested",Packets_tested,"")
11390 PRINT
11400 Print_title("Dynamic Range PER Test Complete")
11410 PRINT
11420 PRINT
11430 !
11440 !***Post test clean up***
11450 !
11460 OUTPUT Testset;"INIT:CPER:OFF"
11470 ! Turn off PER measurement
11480 OUTPUT Testset;"CALL:POW ";Init_cell_power
11490 ! Set cell power back to normal level
11500 DISP ""
11510 !
11520 RETURN
11530 !
11540 Traf_per_awgn:!
11550 !*******************************************************************
11560 ! Subroutine: Packet Error Rate Measurement
11570 ! 3.2.1 Demodulation of Forward Traffic Channel in AWGN
11580 !*******************************************************************
11590 !
11600 DISP "Testing Demod of Traffic Channel in AWGN"
11610 !
11620 !***Set up test parameters***
11630 !
11640 Ior=-55 ! Cell power for test
11650 !
11660 !***Set up measurement parameters***
11670 !
11680 Max_packets=10000 ! Maximum packets
11690 !
11700 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
11710 ! Set MAXIMUM PACKETS for test
11720 OUTPUT Testset;"SETUP:CPERROR:TIMEOUT 25"
11730 ! Set PER measurement timeout to 25 s
11740 !
11750 !***Set test conditions***
11760 !
11770 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 50"
11780 ! Set AT Directed Packets to 50%
11790 OUTPUT Testset;"CALL:POW ";Ior
11800 ! Set cell power for test
11801 OUTPUT Testset;"CALL:MS:PDRop 28"
11802 ! Set Pilot Drop to -14 dB
11803 GOSUB Ftap_connect
11804 ! After setting Pilot Drop, connection will be dropped.
11805 ! Must re-establish the FTAP connection
11810 !
11820 ! Read test data into array.
11830 ! Values are Ioc (AWGN), FTAP data rate, and PER requirement for
11840 ! 18 tests (C.S0033 tests 6 and 10 are not performed because
11850 ! settings are duplicates)
11860 !
11870 RESTORE
11880 DATA -70.4,"S01K2458",1,-68.4,"S01K2458",1,-65.8,"S01K1843",1
11890 DATA -65.1,"S01K1843",1,-60.9,"S02K1229",3,-61.0,"S02K1229",.5
11900 DATA -58.1,"S02B921600",3,-58.2,"S02B921600",.5,-60.5,"S01K1229",1
11910 DATA -55.5,"S02B614400",1,-52.5,"S04B307200",1,-55.6,"S01B614400",5
11920 DATA -55.7,"S01B614400",1,-55.8,"S01B614400",.5,-52.5,"S02B307200",1
11930 DATA -49.4,"S04B153600",1,-46.4,"S08B76800",1,-43.6,"S16B38400",1
11940 !
11950 READ Awgn_per_data$(*)
11960 !
11970 FOR I=1 TO 18
11980 ! Loop to set parameters and measure PER for 18 tests
11990 !
12000 OUTPUT Testset;"SETUP:CPERROR:CONF:REQ "&Awgn_per_data$(I,3)
12010 ! Set CONFIDENCE LIMIT
12020 OUTPUT Testset;"CALL:APPLICATION:FTAP:DRATE "&Awgn_per_data$(I,2)
12030 ! Set FTAP data rate
12040 OUTPUT Testset;"CALL:AWGN:POW "&Awgn_per_data$(I,1)
12050 ! Set AWGN POWER level
12060 WAIT .1
12070 !
12080 !***Obtain measurement results***
12090 !
12100 OUTPUT Testset;"INITIATE:CPERROR"
12110 ! Initiate a packet error rate measurement
12120 DISP "Measuring PER"
12130 OUTPUT Testset;"FETCh:CPERROR?"
12140 ! Query the test set for packet error rate results
12150 ENTER Testset;Integrity,Per_test,Per_ratio,Per_count,Packets_tested
12160 !
12170 SELECT Per_test
12180 ! Assign pass/fail results to a string
12190 CASE 0
12200 Pass_fail$="PASS"
12210 CASE 1
12220 Pass_fail$="FAIL"
12230 CASE 2
12240 Pass_fail$="MAX PACKETS"
12250 CASE 3
12260 Pass_fail$="UNKNOWN"
12270 END SELECT
12280 !
12290 !***Print measurement results***
12300 !
12310 Print_title("Results PER with AWGN, "&Awgn_per_data$(I,2)&" Rate")
12320 PRINT
12330 Print_results("Channel= ",Current_chan,"")
12340 Print_results("Integrity indicator = ",Integrity,"")
12350 Print_res_str("PER Test Results",Pass_fail$)
12360 Print_results("PER Ratio",Per_ratio,"%")
12370 Print_results("PER Errors Count",Per_count,"packets")
12380 Print_results("Packets Tested",Packets_tested,"")
12390 PRINT
12400 !
12410 NEXT I
12420 !
12430 Print_title("PER with AWGN Tests Complete")
12440 PRINT
12450 PRINT
12460 !
12470 !***Post test clean up***
12480 !
12490 OUTPUT Testset;"CALL:AWGN:POW:STATE OFF"
12500 ! Turn off AWGN
12510 OUTPUT Testset;"INIT:CPER:OFF"
12520 ! Turn off PER measurement
12530 OUTPUT Testset;"CALL:POW ";Init_cell_power
12540 ! Set cell power back to normal level
12550 DISP ""
12560 !
12570 RETURN
12580 !
12590 Meas_chan_pow:!
12600 !*******************************************************************
12610 ! Subroutine: Measure Channel Power
12620 ! Implements simple ranging in case over/under range
12630 !*******************************************************************
12640 !
12650 FOR I=1 TO 5
12660 OUTPUT Testset;"INITIATE:CPOWER"
12670 ! Initiate a channel power measurement
12680 OUTPUT Testset;"FETCh:CPOWER?"
12690 ! Fetch channel power measurement results
12700 ENTER Testset;Integrity,Channel_power
12710 ! Read Integrity bit and channel power result
12720 !
12730 IF (Integrity=6 OR Integrity=5) AND 30>Channel_power>-80 THEN
12740 ! Measurement out of-range, recover by setting Receiver
12750 ! control to manual and entering measured level as expected
12760 ! level, then measure channel power again.
12770 ! Repeat up to 5 times.
12780 OUTPUT Testset;"RFAN:CONTROL:POWER:AUTO OFF"
12790 ! Set RF Analyzer ranging to manual
12800 OUTPUT Testset;"RFAN:MANUAL:POWER ";INT(Channel_power);" DBM"
12810 ! Set RF Analyzer expected power to measured level
12820 ELSE
12830 I=5 ! Exits loop if integrity is not under/over range
12840 END IF
12850 !
12860 NEXT I
12870 !
12880 OUTPUT Testset;"RFANALYZER:CONTROL:POWER:AUTO ON"
12890 ! Return expected power control to auto
12900 !
12910 RETURN
12920 !
12930 End_connection: !
12940 !*******************************************************************
12950 ! Subroutine: Close data connection
12960 !*******************************************************************
12970 !
12980 DISP "Closing data connection"
12990 !
13000 OUTPUT Testset;"CALL:DCONNECTED?"
13010 ! Checks connection status
13020 ENTER Testset;Data_stopped
13030 !
13040 IF Data_stopped=0 THEN
13050 DISP "Data connection closed"
13060 !
13070 ELSE
13080 OUTPUT Testset;"CALL:DCONNECTED:TIMEOUT 10"
13090 ! Set connection change detector timeout
13100 OUTPUT Testset;"CALL:DCONNECTED:ARM"
13110 ! Arm the connection state change detector
13120 OUTPUT Testset;"CALL:FUNCTION:DATA:STOP"
13130 ! Close the data connection
13140 OUTPUT Testset;"CALL:DCONNECTED?"
13150 ! Query the data connection status
13160 ENTER Testset;Data_stopped
13170 !
13180 IF Data_stopped=1 THEN
13190 Print_title("Data connection could not be closed")
13200 Print_title("Ending Testing")
13210 GOTO End_program
13220 END IF
13230 !
13240 DISP "Data connection closed"
13250 END IF
13260 !
13270 RETURN
13280 !
13290 Open_rslts_file:!
13300 !*******************************************************************
13310 ! Subroutine: Open text file to save test results to
13320 ! C:\RESULTS\current date\(file name is HID plus current time)
13330 !*******************************************************************
13340 !
13350 Fileopened_flag=0
13360 ! Indicates that a results file is not yet open
13361 Cur_dt$=DATE$(TIMEDATE)
13370 ON ERROR RECOVER Make_dir
13380 ! If error occurs (presumably because the directory doesn't exist),
13390 ! then create directory
13400 MASS STORAGE IS "C:\RESULTS"&"\"&Cur_dt$
13410 ! Sets the current directory
13420 GOTO Skip_create
13430 Make_dir: CREATE DIR "C:\RESULTS"&"\"&Cur_dt$
13440 Skip_create: OFF ERROR
13450 !Returns error handling to the default: "report to user with a pause"
13460 Cur_tm$=TIME$(TIMEDATE)
13470 Cur_tm$[3]="_"&Cur_tm$[4]
13480 ! Replace the ":" in TIME$ to "_"
13490 Cur_tm$[6]="_"&Cur_tm$[7]
13500 ! Replace the ":" in TIME$ to "_"
13510 Result_file$=Hid_dec$[4,11]&" "&Cur_tm$&".txt"
13520 ! Name the result file using HID and current time
13530 CREATE Result_file$,130
13540 ! Create the result file with 130 records
13550 ASSIGN @File TO Result_file$
13560 ! Wherever @File appears, use Result_file$
13570 ! Create data file using hardware ID and current time
13580 COM /File/@File
13590 Fileopened_flag=1
13600 ! Set open file flag to true
13610 RETURN
13620 !
13630 Start_time:!
13640 !*******************************************************************
13650 ! Subroutine: Start Test Time
13660 !*******************************************************************
13670 !
13680 Start_time=TIMEDATE
13690 RETURN
13700 !
13710 End_time:!
13720 !*******************************************************************
13730 ! Subroutine: End Test Time
13740 !*******************************************************************
13750 !
13760 End_time=TIMEDATE
13770 RETURN
13780 !
13790 End_program:!
13800 !*******************************************************************
13810 ! Subroutine: End of all testing clean up
13820 !*******************************************************************
13830 !
13840 GOSUB End_time
13850 Print_title("End of Test")
13860 Print_results("Total Test Time= ",End_time-Start_time," Seconds")
13870 !
13880 !***End connection and return to default call processing settings***
13890 !
13900 OUTPUT Testset;"CALL:POW ";Init_cell_power
13910 ! Set cell power back to normal level
13920 OUTPUT Testset;"CALL:CHAN ";Primary_channel
13930 ! Set Primary RF Channel for selected System Type and Cell Band
13940 !
13950 IF Fileopened_flag THEN ASSIGN @File TO *
13960 ! Close the data file
13970 !
13980 PRINT
13990 PRINT "End of Program"
14000 END
14010 !
14020 !**************************************************************************
14030 ! SUB-PROGRAM SECTION
14040 !**************************************************************************
14050 !
14060 Timeout: SUB Timeout ! Global timeout handler
14070 COM Testset,Result_file$
14080 PRINT
14090 PRINT "Program timed out, check setup"
14100 CLEAR 7
14110 CLEAR Testset
14120 STOP
14130 SUBEND
14140 !
14150 Print_results: SUB Print_results(Name$,Res1,OPTIONAL Units$)
14160 COM Testset,Result_file$
14170 COM /File/Openfile_flag
14180 IF Res1=9.91E+37 THEN
14190 PRINT USING "5X,40A,5X,1D.E,1X,20A";Name$;Res1;Units$
14200 IF Openfile_flag THEN
14210 COM /File/@File
14220 OUTPUT @File USING "5X,40A,5X,1D.E,1X,20A";Name$;Res1;Units$
14230 END IF
14240 ELSE
14250 PRINT USING "5X,40A,5X,M4D.2D,1X,20A";Name$;Res1;Units$
14260 IF Openfile_flag THEN
14270 OUTPUT @File USING "5X,40A,5X,M4D.2D,1X,20A";Name$;Res1;Units$
14280 END IF
14290 END IF
14300 SUBEND
14310 !
14320 Print_res_str: SUB Print_res_str(String_name$,OPTIONAL Results$)
14330 COM Testset,Result_file$
14340 COM /File/Openfile_flag
14350 PRINT USING "5X,40A,5X,20A";String_name$;Results$
14360 IF Openfile_flag THEN
14370 COM /File/@File
14380 OUTPUT @File USING "5X,40A,5X,20A";String_name$;Results$
14390 END IF
14400 SUBEND
14410 !
14420 Print_title: SUB Print_title(Title$)
14430 COM Testset,Result_file$
14440 COM /File/Openfile_flag
14450 PRINT USING "3X,72A";Title$
14460 IF Openfile_flag THEN
14470 COM /File/@File
14480 OUTPUT @File USING "2A,/";" "
14490 OUTPUT @File USING "3X,72A,/";Title$
14500 END IF
14510 SUBEND
14520 !
14530 Connected: DEF FNConnected ! Function to check connected state
14540 COM Testset,Result_file$
14550 OUTPUT Testset;"CALL:DCONNECTED?"
14560 ! Query the connected status
14570 ENTER Testset;Connected
14580 RETURN Connected
14590 ! Function returns 1 for connected, 0 for idle or session open
14600 FNEND
14610 !
14620 Session_check: DEF FNSession_check ! Function to check session open state
14630 COM Testset,Result_file$
14640 OUTPUT Testset;"CALL:SOPEN?"
14650 ! Query the session open state
14660 ENTER Testset;Session_check
14670 RETURN Session_check
14680 ! Function returns 1 for session open, 0 for idle or connected
14690 FNEND