Comprehensive Program Example for AT Test (based on ETAP test data connection)

Comprehensive Program Example for AT Test (based on ETAP test data connection)

Last updated: May 24, 2006

 
10 !******************************************************************************
20 ! E1966A Comprehensive Programming Example - Rel A Subtype 2 Physical Layer
30 ! Revision: June 18, 2006
40 !
50 ! This program is for subtype 2 physical layer tests.
51 ! It opens an RETAP 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 FETAP 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$[50]      ! 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\current date
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$(1,3)[20]
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"
570       ! 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 !
671  P_rev$="PRA"                      ! Set to protocol release A
672  Phy_sub$="SUBT2"                  ! Set to physical layer subtype 2
680  Band$="USC"                     ! Set cell band
690  Primary_channel=129               ! 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 !
980  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 RETAP 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 Retap_connect
1400       ! Open an RETAP 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 FETAP connection)
1630 !**************************************************************************
1640 WAIT .2
1650 GOSUB Fetap_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 Retap_connect         ! Move to an RETAP 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 Fetap_connect         ! Move to an FETAP connection
1910 !
1920 !      GOSUB Sensitivity
1930 !      GOSUB Dynamic_range
1940 !      GOSUB Traf_per_awgn
1950 !
1960 !      GOSUB Retap_connect         ! Move to an RETAP 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 Fetap_connect         ! Move to an FETAP 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 !
2571 OUTPUT Testset;"CALL:PROTocol ";P_rev$
2572       ! Set protocol release
2573 OUTPUT Testset;"CALL:PROTocol:PLAYer ";Phy_sub$
2574       ! Set physical layer subtype for Release A
2575 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  Retap_connect:!
3230 !*******************************************************************
3240 ! Subroutine: Open an RETAP connection
3250 !*******************************************************************
3260 !
3270 DISP "Opening (or Moving to) an RETAP 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 RETAP and
3400           ! open a connection
3410     DISP "Session is open, opening an RETAP connection now"
3420 !
3430     OUTPUT Testset;"CALL:APPLication:ETAPlication REVerse"
3440           ! Set application type to RETAP (for AT transmitter testing)
3450     OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT256"
3460           ! Set Reverse data packet size to 256 bits.
3470     GOSUB Start_data
3480 !
3490 ELSE
3500     DISP "Connection is currently open, changing to RETAP"
3510           ! If state is connected, then change to RETAP
3520     OUTPUT Testset;"CALL:APPLication:ETAPlication REVerse"
3530           ! Set application type to RETAP (for AT transmitter testing)
3540     OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT256"
3550           ! Set Reverse data packet size to 256 bits.
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 RETAP connection now"
3690               !GOSUB Start_data
3700           !END IF
3710 !
3720     DISP "RETAP Connection Open"
3730 !
3740 END IF
3750 !
3760 RETURN
3770 !
3780  Fetap_connect:!
3790 !*******************************************************************
3800 ! Subroutine: Open an FETAP connection
3810 !*******************************************************************
3820 !
3830 DISP "Opening (or Moving to) an FETAP 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 FETAP and
3960           ! open a connection
3970     DISP "Session is open, opening an FETAP connection now"
3980 !
3990     OUTPUT Testset;"CALL:APPLication:ETAPlication FORWard"
4000           ! Set application type to FETAP  (for AT Receiver testing)
4010     OUTPUT Testset;"CALL:APPLication:TRAFfic:FORMat 4,1024,2,128"
4020           ! Set F-Traffic transmission format resulting in 307.2kbps,2slots
4030     GOSUB Start_data
4040 !
4050 ELSE
4060     DISP "Connection is currently open, changing to FETAP"
4070           ! If state is connected, then change to FETAP
4080     OUTPUT Testset;"CALL:APPLication:ETAPlication FORWard"
4090           ! Set application type to FETAP  (for AT Receiver testing)
4100     OUTPUT Testset;"CALL:APPLication:TRAFfic:FORMat 4,1024,2,128"
4110           ! Set F-Traffic transmission format resulting in 307.2kbps,2slots
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 FETAP connection now"
4240         GOSUB Start_data
4250     END IF
4260 !
4270     DISP "FETAP 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
4932 !             4.1.2 Frequency Accuracy
4933 !             4.2.1 Timer Reference (static test only)
4940 !             4.2.2 Waveform Quality and Frequency Accuracy
4941 !             4.3.7 RRI Channel Output Power
4942 !             4.3.8.1 DRC Channel Output Power (for test 2)
4943 !             4.3.8.2 ACK Channel Output Power (for test 2)
4945 !             4.3.8.4 DSC Channel Output Power (for test 1)
4946 !             4.3.8.3 Data Channel Output Power (for test 1)
4947 !             4.3.8.3 Data Channel Output Power (for test 8)
4950 !*******************************************************************
4960 !
4970 DISP "Measuring Waveform Quality and Code Domain Power"
4980 !
4990 !***Set up test parameters***
4991 ! To simplify the program, only one example of those tests as specified
4992 ! in standard are given here. You can refer to this example to program
4993 ! your test cases.
5000 !
5010 Ior=-75              ! Cell power for tests
5011 Drc_gain=3          ! DRC channel gain. Change as desired.
5012 Ack_gain=3          ! Ack channel gain. Change as desired.
5013 Dsc_gain=-9          ! DSC channel gain. Change as desired.
5014 Rri_gain=-6          ! RRI channel gain. Change as desired
5015 Meas_slots=2          ! Set slots to measure. Change as desired.
5020 !
5021 !
5022 OUTPUT Testset;"CALL:MACChannel:ARQ:ACK:DATA SUBP0"
5023       ! Set Ack R-Data After to subpacket 0.
5030 OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT256"
5040       ! Set R-Data Packet size to 256 bits.
5041 OUTPUT Testset;"CALL:APPLication:DATA:TRANsmission HCAPacity"
5042       ! Set R-Data transmission mode to high capacity.
5043       !OUTPUT Testset;"CALL:MS:T2Pilot:BIT256:HCAPacity:TRANsition 3"
5044       ! Set 256 bits high capacity T2P Tranistion to 4 subframes.
5045       ! It is required only if you've change the test set default value.
5046       ! NOTE:changing this parameter results in a session renegotionation,
5047       ! You should set this parameter prior to a data connection.
5048       !OUTPUT Testset;"CALL:MS:T2Pilot:BIT256:HCAPacity:TARGet 3"
5049       ! Set 256 bits high capacity termination target to 4 subframes.
5052       ! It is required only if you've change the test set default value.
5053       ! NOTE:changing this parameter results in a session renegotionation,
5054       ! You should set this parameter prior to a data connection.
5055 OUTPUT Testset;"CALL:APPLICATION:ACKCHANNEL:BFMATTRIBUTE ON"
5056       ! Turn on ACK Channel Bit Fixed Mode Attribute. It is required
5057       ! only if you've change the test set default setting.
5058       !OUTPUT Testset;"CALL:MS:RRIGain:TRANsition3:PRE ";Rri_gain
5059       ! Only required for 4.3.7 test. Set RRIChannelGainPreTransition3 to -6dB.
5061       ! It is required only if you've change the test set default setting.
5062       ! NOTE:changing this parameter results in a session renegotionation,
5063       ! You should set this parameter prior to a data connection.
5064 OUTPUT Testset;"CALL:MS:DRCGain ";Drc_gain
5065       ! Only required for 4.3.8.1 test.
5066       ! Set DRC ChannelGain to 3 dB for test 2.
5067       ! It is required only if you've change the test set default setting.
5069 OUTPUT Testset;"CALL:MS:ACKGain ";Ack_gain
5070       ! Only for 4.3.8.2 test. Set ACK ChannelGain to 3 dB.
5071       ! It is required only if you've change the test set default setting.
5073 OUTPUT Testset;"CALL:MS:DSCGain ";Dsc_gain
5074       ! Only for 4.3.8.4 test. Set DSC ChannelGain to -9 dB.
5075       ! It is required only if you've change the test set default setting.
5077 OUTPUT Testset;"CALL:POW ";Ior
5078       ! Set cell power
5079 WAIT .1
5080 !
5081 !***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 ";Meas_slots
5130       ! Set slots to measure.
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
5211       !
5220 OUTPUT Testset;"FETCh:DOWQuality:CDPower:RRIChannel?"
5221       ! Query the test set for RRI channel CDP measurement results.
5222 ENTER Testset;Rri_chan,Rri_walsh,Rri_sf,Rri_cdp,Rri_total_cdp,Rri_norm_total,Rri_delta_pilot
5223       !
5224 OUTPUT Testset;"FETCh:DOWQuality:CDPower:DRCChannel?"
5225       ! Query the test set for DRC channel CDP measurement results.
5226 ENTER Testset;Drc_chan,Drc_walsh,Drc_sf,Drc_cdp,Drc_total_cdp,Drc_norm_total,Drc_delta_pilot
5227       !
5228 OUTPUT Testset;"FETCh:DOWQuality:CDPower:ACKChannel?"
5229       ! Query the test set for ACK channel CDP measurement results.
5230 ENTER Testset;Ack_chan,Ack_walsh,Ack_sf,Ack_cdp,Ack_total_cdp,Ack_norm_total,Ack_delta_pilot
5231       !
5232 OUTPUT Testset;"FETCh:DOWQuality:CDPower:DSCChannel?"
5233       ! Query the test set for DSC channel CDP measurement results.
5234 ENTER Testset;Dsc_chan,Dsc_walsh,Dsc_sf,Dsc_cdp,Dsc_total_cdp,Dsc_norm_total,Dsc_delta_pilot
5235 !
5236 OUTPUT Testset;"FETCh:DOWQuality:CDPower:DATA?"
5237       ! Query the test set for Data channel CDP measurement results
5238       ! for Test 1: 256 bits R-Data Pkt size.
5239 ENTER Testset;T1_chan,T1_walsh,T1_sf,T1_cdp,T1_total_cdp,T1_norm_cdp,T1_delta_pilot
5240 !
5243 !
5244 !***Print Waveform Quality results***
5245 !
5250 Print_title("Waveform Quality Test Results:")
5260 PRINT
5270 Print_results("Channel/Band= ",Current_chan,Band$)
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 !***Print RRI Channel Code Domain results***
5411 !
5412 Print_title("RRI Channel Output Power Results:")
5413 PRINT
5414 IF (Rri_chan=0) THEN
5416 Print_results("RRI walsh code =",Rri_walsh,"on I channel")
5417 ELSE
5418 Print_results("RRI walsh code =",Rri_walsh,"on Q channel")
5419 END IF
5420 Print_results("Spread Factor (SF) = ",Rri_sf,"")
5421 Print_results("RRI Power Relative to R-Pilot= ",Rri_delta_pilot,"dB")
5422 PRINT
5425 Print_title("RRI Channel Output Power Test Complete")
5427 PRINT
5428 PRINT
5429       !
5430 !***Print DRC Channel Code Domain results***
5440 !
5441 Print_title("DRC Channel Output Power Results:")
5442 PRINT
5443 IF (Drc_chan=0) THEN
5444 Print_results("DRC walsh code =",Drc_walsh,"on I channel")
5445 ELSE
5446 Print_results("DRC walsh code =",Drc_walsh,"on Q channel")
5447 END IF
5448 Print_results("Spread Factor (SF) = ",Drc_sf,"")
5449 Print_results("DRC Power Relative to R-Pilot= ",Drc_delta_pilot,"dB")
5450 PRINT
5451 Print_title("DRC Channel Output Power Test Complete")
5452 PRINT
5453 PRINT
5454       !
5455 !***Print ACK Channel Code Domain results***
5456 !
5457 Print_title("ACK Channel Output Power Results:")
5458 PRINT
5459 IF (Ack_chan=0) THEN
5460 Print_results("ACK walsh code =",Ack_walsh,"on I channel")
5461 ELSE
5462 Print_results("ACK walsh code =",Ack_walsh,"on Q channel")
5464 END IF
5465 Print_results("Spread Factor (SF) = ",Ack_sf,"")
5466 Print_results("ACK Power Relative to R-Pilot = ",Ack_delta_pilot,"dB")
5467 PRINT
5468 Print_title("ACK Channel Output Power Test Complete")
5469 PRINT
5470 PRINT
5471       !
5472 !***Print DSC Channel Code Domain results***
5481 !
5482 Print_title("DSC Channel Output Power Results:")
5483 PRINT
5484 IF (Dsc_chan=0) THEN
5485 Print_results("DSC walsh code =",Dsc_walsh,"on I channel")
5486 ELSE
5487 Print_results("DSC walsh code =",Dsc_walsh,"on Q channel")
5488 END IF
5489 Print_results("Spread Factor (SF) = ",Dsc_sf,"")
5490 Print_results("DSC Power Relative to R-Pilot= ",Dsc_delta_pilot,"dB")
5491 PRINT
5492 Print_title("DSC Channel Output Power Test Complete")
5493 PRINT
5494 PRINT
5495       !
5496 !***Print Data Channel Code Domain results for R-Data Pkt Size 256 bits (Test 1)***
5497 !
5498 Print_title("Data Channel Output Power Results (256 bits pkt size):")
5499 PRINT
5500 IF (T1_chan=0) THEN
5501 Print_results("R-Data walsh code =",T1_walsh,"on I channel")
5502 ELSE
5503 Print_results("R-Data walsh code =",T1_walsh,"on Q channel")
5504 END IF
5505 Print_results("Spread Factor (SF) = ",T1_sf,"")
5506 Print_results("R-Data Power Relative to R-Pilot = ",T1_delta_pilot,"dB")
5507 PRINT
5508 Print_title("Data Channel Output Power Test Complete")
5509 PRINT
5510 PRINT
5511 !
5513 !***Set up test parameters for 4.3.8.3 (test 8)***
5531 !
5532 OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT3072"
5533       ! Set R-Data Packet size to 3072 bits.
5538       ! It is required only if you've change the test set default value.
5539       !OUTPUT Testset;"CALL:MS:T2Pilot:BIT3072:HCAPacity:TARGet 3"
5540       ! Set 3072 bits high capacity termination target to 4 subframes.
5541       ! It is required only if you've changed test set default value.
5542       ! NOTE:changing this parameter results in a session renegotiation,
5543       ! You should set this parameter prior to a data connection. Otherwise,
5544       ! you need to re-open the connection
5545       !OUTPUT Testset;"CALL:MS:APPayload BIT3072"
5546       ! Set auxiliary pilot channel minimum playload to 3072 bits.
5547       ! It is required only if you've change the test set default setting.
5548       ! NOTE:changing this parameter results in a session renegotiation,
5549       ! You should set this parameter prior to a data connection. Otherwise,
5550       ! you need to re-open the connection.
5551 !
5552 !***Set up measurement parameters for 4.3.8.3 (test 8)***
5561 !
5564 OUTPUT Testset;"SETUP:DOWQ:SLOT:COUNT 1"
5565       ! Set slots to measure to 1
5566 !
5567 !***INITiate and FETCh measurement results for 4.3.8.3 (test 8)***
5568 !
5569 OUTPUT Testset;"INITiate:DOWQuality"
5570       ! Initiate a waveform quality + code domain measurement
5571 !
5572 OUTPUT Testset;"FETCh:DOWQuality:CDPower:DATA?"
5573       ! Query for Data channel CDP results for R-Data Pkt Size 3072 bits (test 8).
5574 ENTER Testset;T8_chan,T8_walsh,T8_sf,T8_cdp,T8_total_cdp,T8_norm_cdp,T8_delta_pilot
5575 !
5576 OUTPUT Testset;"FETCh:DOWQuality:CDPower:DATA:RTPilot?"
5577       ! Query for CDP power of each walsh channel constituting the Data channel.
5579 ENTER Testset;T8_chan,Cdp_1,Cdp_2,Cdp_3,Cdp_4
5580       !
5581 OUTPUT Testset;"FETCh:DOWQuality:CDPower:PILot:AUXiliary?"
5582       ! Query for Auxiliary Pilot channel CDP results.
5583 ENTER Testset;Ap_chan,Ap_walsh,Ap_sf,Ap_cdp,Ap_total_cdp,Ap_norm_cdp,Ap_delta_pilot
5584       !
5585 !***Print Data Channel Code Domain results for R-Data Pkt Size 3072 bits (Test 8)***
5586 !
5587 Print_title("Data Channel Output Power Results (3072 bits pkt size):")
5588 PRINT
5589     SELECT T8_chan
5590           ! Set step direction for each measurement
5591     CASE 1
5592         Modu_typ$="B4"
5593         Walsh_ch$="1 walsh channel"
5594         Print_res_str("R-Data Modulation Type is ",Modu_typ$)
5595         Print_res_str("R-Data occupies ",Walsh_ch$)
5596         Print_results("R-Data on Q:2(SF=4) Relative to R-Pilot= ",Cdp1,"dB")
5597         Print_results("R-Data Power Relative to R-Pilot= ",T8_delta_pilot,"dB")
5598     CASE 2
5599         Modu_typ$="Q4"
5600         Walsh_ch$="2 walsh channel"
5602         Print_res_str("R-Data Modulation Type is ",Modu_typ$)
5603         Print_res_str("R-Data occupies ",Walsh_ch$)
5605         Print_results("R-Data on I:2(SF=4) Rel.to R-Pilot= ",Cdp1,"dB")
5606         Print_results("R-Data on Q:2(SF=4) Rel.to R-Pilot= ",Cdp2,"dB")
5607         Print_results("R-Data Power Relative to R-Pilot= ",T8_delta_pilot,"dB")
5608     CASE 3
5609         Modu_typ$="Q2"
5610         Wwalsh_ch$="2 walsh channel"
5612         Print_res_str("R-Data Modulation Type is ",Modu_typ$)
5613         Print_res_str("R-Data occupies ",Walsh_ch$)
5615         Print_results("R-Data on I:1(SF=2) Rel.to R-Pilot= ",Cdp1,"dB")
5616         Print_results("R-Data on Q:1(SF=2) Rel. to R-Pilot= ",Cdp2,"dB")
5617         Print_results("R-Data Power Relative to R-Pilot= ",T8_delta_pilot,"dB")
5618     CASE 4
5619         Modu_typ$="Q4Q2"
5620         Walsh_ch$="4 walsh channel"
5622         Print_res_str("R-Data Modulation Type is ",Modu_typ$)
5623         Print_res_str("R-Data occupies ",Walsh_ch$)
5624         Print_results("R-Data on I:2(SF=4) Rel. to R-Pilot= ",Cdp1,"dB")
5628         Print_results("R-Data on I:1(SF=2) Rel. to R-Pilot= ",Cdp2,"dB")
5629         Print_results("R-Data on Q:2(SF=4) Rel. to R-Pilot= ",Cdp3,"dB")
5630         Print_results("R-Data on Q:1(SF=2) Rel. to R-Pilot= ",Cdp4,"dB")
5631         Print_results("R-Data Power Relative to R-Pilot= ",T8_delta_pilot,"dB")
5632     CASE 5
5633         Modu_typ$="E4E2"
5634         Walsh_ch$="4 walsh channel"
5636         Print_res_str("R-Data Modulation Type is ",Modu_typ$)
5637         Print_res_str("R-Data occupies ",Walsh_ch$)
5640         Print_results("R-Data on I:2(SF=4) Rel. to R-Pilot= ",Cdp1,"dB")
5641         Print_results("R-Data on I:1(SF=2) Rel. to R-Pilot= ",Cdp2,"dB")
5642         Print_results("R-Data on Q:2(SF=4) Rel. to R-Pilot= ",Cdp3,"dB")
5643         Print_results("R-Data on Q:1(SF=2) Rel. to R-Pilot= ",Cdp4,"dB")
5644         Print_results("R-Data power Relative to R-Pilot= ",T8_delta_pilot,"dB")
5645     CASE ELSE
5646         Print_res_str("Invalid measurement results","")
5647     END SELECT
5648 PRINT
5649 PRINT
5650 !
5651 !***Print Auxiliary Pilot Channel Code Domain results***
5652 !
5653 Print_title("Auxiliary Pilot Channel Output Power Results (R-Data Pkt Size=3072bits):")
5654 PRINT
5655 IF (Ap_chan=0) THEN
5656 Print_results("Auxiliary Pilot walsh code =",Ap_walsh,"on I channel")
5657 ELSE
5658 Print_results("Auxiliary Pilot walsh code =",Ap_walsh,"on Q channel")
5659 END IF
5660 Print_results("Spread Factor (SF) = ",Ap_sf,"")
5661 Print_results("Auxiliary Pilot Power Relative to R-Pilot= ",Ap_delta_pilot,"dB")
5662 PRINT
5663       !
5664 Print_title("Data Channel Output Power Test for 3072 pkt size Complete")
5665 PRINT
5666 PRINT
5667                 !
5668 !***Post test clean up***
5669 !
5670 OUTPUT Testset;"INIT:DOWQ:OFF"
5671 OUTPUT Testset;"CALL:POW ";Init_cell_power
5672       ! Set cell power back to initial level
5673 DISP ""
5674 !
5675 RETURN
5676 !
5677  Max_pow_spur:!
5678 !*******************************************************************
5679 ! Subroutine: Digital Average Power and
5680 !             TX Spurious Emissions Measurements
5681 !             4.3.4 Maximum RF Output Power
5682 !             4.4.1 Conducted Spurious Emissions
5683 !*******************************************************************
5684 !
5685 DISP "Measuring Maximum Power and TX Spurious Emissions"
5686 !
5687 !***Set up test parameters***
5688 !
5689 Ior=-60                         ! Set cell power for test
5690 !
5691 IF Band$="KPCS" OR Band$="USPCS" OR Band$="USPCs1900" OR Band$="IMT2000" THEN
5692       !
5693       ! Set open loop adjust for test
5694     Ol_adjust=84
5695 ELSE
5696     Ol_adjust=81
5697 END IF
5710 !
5721 OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT4096"
5722       ! Set R-Data Packet size to 4096 bits.
5723 OUTPUT Testset;"CALL:APPLication:DATA:TRANsmission HCAPacity"
5724       ! Set R-Data transmission mode to high capacity.
5725 !OUTPUT Testset;"CALL:MS:T2Pilot:BIT4096:HCAPacity:TARGet 3"
5726       ! Set 4096 bits high capacity termination target to 4 subframes.
5727       ! It is required only if you've changed test set default value.
5728       ! NOTE:changing this parameter results in a session renegotiation,
5729       ! You should set this parameter prior to a data connection. Otherwise,
5730       ! you need to re-open the connection
5734 OUTPUT Testset;"CALL:APPLication:TRAFfic:FORMat 4,1024,2,128"
5735       ! Set F-Traffic transmission format to 307.2 kbps (2 slots).
5736 OUTPUT Testset;"CALL:APPLication:ACKChannel:BFMAttribute 1"
5737       ! Set Ack channel bit fixed mode attribute to On.
5738       !
5739 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
5770 OUTPUT Testset;"CALL:APAR:PROBE:POWER:STEP 7.5"
5860       ! Set Probe Power 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/Band= ",Current_chan,Band$)
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/Band= ",Current_chan,Band$)
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 so signaling
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
6810 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:DATA:PACKet BIT256"
7070       ! Set R-Data Packet size to 256 bits.
7071 OUTPUT Testset;"CALL:APPLication:DATA:TRANsmission HCAPacity"
7072       ! Set R-Data transmission mode to high capacity.
7073       !OUTPUT Testset;"CALL:MS:T2Pilot:BIT256:HCAPacity:TARGet 3"
7074       ! Set 256 bits high capacity termination target to 4 subframes.
7075       ! It is required only if you've change the test set default value.
7076       ! NOTE:changing this parameter results in a session renegotionation,
7077       ! You should set this parameter prior to a data connection.
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/Band= ",Current_chan,Band$)
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
7930 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/Band= ",Current_chan,Band$)
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
8870 !
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***
9130 !
9140 OUTPUT Testset;"CALL:APPLication:DATA:PACKet BIT256"
9141       ! Set R-Data Packet size to 256 bits.
9142 OUTPUT Testset;"CALL:APPLication:DATA:TRANsmission HCAPacity"
9143       ! Set R-Data transmission mode to high capacity.
9144       !OUTPUT Testset;"CALL:MS:T2Pilot:BIT256:HCAPacity:TARGet 3"
9145       ! Set 256 bits high capacity termination target to 4 subframes.
9146       ! It is required only if you've change the test set default value.
9147       ! NOTE:changing this parameter results in a session renegotionation,
9148       ! You should set this parameter prior to a data connection.
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/Band= ",Current_chan,Band$)
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
10061 Conf_limit=95                      ! 95% confidence limit
10070 Per_limit=.5                      ! 0.5% PER requirement
10080 !
10090 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
10100       ! Set Maximum Packets for tests
10101 OUTPUT Testset;"SETUP:CPERROR:CONF ";Conf_limit
10102       ! Set Confidence limit
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:TRAFfic:FORMat 4,1024,2,128"
10210       ! Set F-Traffic Format to DRC value of 2, 1024 bits pkt size,
10211       ! 2 slot duration, 128 chips preamble (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/Band= ",Current_chan,Band$)
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=95                      ! 95% confidence limit
10890 Per_limit=.5                      ! 0.5% PER requirement
10900 !
10910 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
10920       ! Set Maximum Packets for tests
10930 OUTPUT Testset;"SETUP:CPERROR:CONF ";Conf_limit
10931       ! Set Confidence limit
10932 OUTPUT Testset;"SETUP:CPERROR:CONF:REQ ";Per_limit
10933       ! Set PER requirement
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%
11001       !
11002 FOR I=1 TO 2
11003       ! Loop to set parameters and measure PER for tests 2 and 3
11004 !
11005    IF (I=1) THEN
11006      Data_rate$="4,1024,2,128"
11008             ! Set F-Traffic Format to DRC value of 2, 1024 bits pkt size,
11009             ! 2 slot duration, 128 chips preamble (307.2 kbps) for test 2.
11010      Drate_str$="307.2 kbps"
11011    ELSE
11012      Data_rate$="12,4096,1,64"
11013             ! Set F-Traffic Format to DRC value of 12, 4096 bits pkt size,
11014             ! 1 slot duration, 64 chips preamble (2457.6 kbps) for test 3.
11015      Drate_str$="2457.6 kbps"
11016    END IF
11017           !
11018 OUTPUT Testset;"CALL:APPLication:TRAFfic:FORMat ";Data_rate$
11020       ! Set F-Traffic Format to DRC value of 2, 1024 bits pkt size,
11021       ! 2 slot duration, 128 chips preamble (307.2 kbps).
11022 WAIT .2
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_res_str("Dynamic Range Packet Error Rate Test Results at ",Drate_str$)
11320 PRINT
11330 Print_results("Channel/Band= ",Current_chan,Band$)
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
11421       !
11422 NEXT I
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
11491 WAIT .1
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
11571 !             (The following example is for test 19)
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
11681 Conf_limit=95                      ! 95% confidence limit
11682 Min_packets=100        !Minimum packets
11690 !
11700 OUTPUT Testset;"SETUP:CPERROR:COUNT ";Max_packets
11710       ! Set MAXIMUM PACKETS for test
11711 OUTPUT Testset;"SETUP:CPERROR:COUNT:MINimum ";Min_packets
11712       ! Set MAXIMUM PACKETS for test
11713 OUTPUT Testset;"SETUP:CPERROR:CONF ";Conf_limit
11714       ! Set Confidence limit
11720 OUTPUT Testset;"SETUP:CPERROR:TIMEOUT 200"
11730       ! Set PER measurement timeout to 200 s
11740 !
11750 !***Set test conditions***
11760 !
11770 OUTPUT Testset;"CALL:APPLICATION:ATDPACKETS 50"
11780       ! Set AT Directed Packets to 50%
11781 OUTPUT Testset;"CALL:APPLICATION:ACKChannel:BFMAttribute OFF"
11782       ! Turn off ACK channel fixed mode attribute
11792 OUTPUT Testset;"CALL:POW ";Ior
11800       ! Set cell power for test
11801 OUTPUT Testset;"CALL:MS:PDRop 32"
11802       ! Set Pilot Drop to -16 dB
11803 WAIT .2
11804 GOSUB Fetap_connect
11805       ! After setting Pilot Drop, connection will be dropped.
11806       ! Must re-establish the FETAP connection
11810 !
11811 !
11820 ! Read test data into array.
11830 ! Values are Ioc (AWGN), F-Traffic Format, and PER requirement for
11840 ! 12 tests (tests 19 to 30) for subtype 2 physical layer.
11870 !RESTORE
11880 !DATA -52.5,"6,512,1,64",1,-49.72,"6,256,1,64",1,-48.07,"6,128,1,64",1
11890 !DATA -43.5,"2,512,8,512",1,-44.0,"3,256,4,256",1,-45.54,"4,128,2,128",1
11900 !DATA -47.07,"1,512,16,1024",1,-44.51,"1,256,16,1024",1,-45.68,"1,128,16,1024",1
11910 !DATA -63.11,"13,5120,2,64",1,-78.44,"14,5120,1,64",1,-75.45,"14,5120,1,64",1
11940 !
11941 !
11942 ! Read test data into array.
11943 ! Values are Ioc (AWGN), F-Traffic Format, and PER requirement for
11944 ! 12 tests (tests 19 to 30) for subtype 2 physical layer.
11945 RESTORE
11946 DATA -52.5,"6,512,1,64",1
11950 READ Awgn_per_data$(*)
11960 !
11970 FOR I=1 TO 1
11980       ! Loop to set parameters and measure PER for 18 tests
11991 !
11992    !IF (I<6 OR I>9) THEN
11993      Max_pkts=16
11994    !ELSE
11995      !Max_pkts=4
11996    !END IF
11997           !
11998    OUTPUT Testset;"CALL:APPLication:TRAFfic:PDURation:MAXimum ";Max_pkts
11999           ! Set Max Forward Packet Duration which may result in
12000           ! effective data rate lower than nominal data rate.
12004    OUTPUT Testset;"SETUP:CPERROR:CONF:REQ "&Awgn_per_data$(I,3)
12005           ! Set CONFIDENCE LIMIT
12010           !
12020    OUTPUT Testset;"CALL:APPLication:TRAFfic:FORMat "&Awgn_per_data$(I,2)
12030           ! Set FETAP data rate
12031    WAIT .5
12040    OUTPUT Testset;"CALL:AWGN:POW "&Awgn_per_data$(I,1)
12050           ! Set AWGN POWER level
12060    WAIT .5
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/Band= ",Current_chan,Band$)
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
12391   !
12392 OUTPUT Testset;"CALL:AWGN:POW:STATE OFF"
12393       ! Turn off AWGN
12394 WAIT .2
12400 !
12410 NEXT I
12420 !
12430 Print_title("PER with AWGN Tests Complete")
12440 PRINT
12450 PRINT
12460 !
12470 !***Post test clean up***
12480 !
12501 OUTPUT Testset;"CALL:APPLICATION:ACKChannel:BFMAttribute OFF"
12502       ! Turn ACK channel fixed mode attribute back to on
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
12811        WAIT .5
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
12891       WAIT .5
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
13370 Cur_dt$=DATE$(TIMEDATE)
13380 ON ERROR RECOVER Make_dir
13390       ! If error occurs (presumably because the directory doesn't exist),
13400       ! then create directory
13410 MASS STORAGE IS "C:\RESULTS"&"\"&Cur_dt$
13420       ! Sets the current directory
13430 GOTO Skip_create
13440  Make_dir: CREATE DIR "C:\RESULTS"&"\"&Cur_dt$
13441  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,M5D.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

Related Topics


Test Adherence to Standards

C.S0029 Test Application Specification Description (TAP/ETAP)