Instrument BASIC

Programming and Using the TESTS Subsystem

Program Example

The following example IBASIC program uses the basic algorithm shown above and the TESTS subsystem to execute a number of test subroutines at a number of defined test frequencies. Also included are examples of how to interact with the user-interface to allow a user to access parameters, specifications, and configuration fields to define a specific set of test requirements.

An explanation of the program example is given at the end of the listing.

Program Listing

10! DEMO_1

20!

30! THE FIRST LINE MUST CONTAIN THE NAME OF THE LIBRARY

40!

50!__________________________________________________________

60!

70! THIS PROGRAM IS A DEMO PROGRAM TO DEMONSTRATE THE USE

80! OF THE TEST SUBSYSTEM ON THE Agilent 8922M

90!

100! REVISION: 1 APRIL, 1991

110!___________________________________________________________

120!

130COM /I_o/ I_o$[470]

140! INPUT OUTPUT STRING

150COM /Freq/ Rx_f,Tx_f

160! PRESENT RX AND TX FREQUENCIES IN MHZ

170!

180INTEGER Test_return

190! TITLE SCREEN FOR OUR TESTS

200CLEAR SCREEN

210PRINT TABXY(2,2),”___DEMO PROGRAM FOR THE TESTS SUBSYSTEM___”

220!

230! SET UP A SOFT KEY TO HALT THE PROGRAM

240ON KEY 1 LABEL “Stop Test”,5 GOTO Stp_test

250!

260! CLEAR THE INTERNAL HP 8922M BUS

270CLEAR 800

280!

290! NOW READ THE TEST FREQUENCIES IN ONE AT A TIME AND DO THE

300! SEQUENCE OF TESTS ON THEM

310Ch=1

320REPEAT

330OUTPUT 800;”TESTS:FREQ? “&VAL$(Ch)

340I_o$=””

350ENTER 800;I_o$

360

!

SET THE VALUE OF THE RX FREQUENCY

370

Rx_f=VAL(I_o$[4;12])

 

380

!

SET THE VALUE OF THE TX FREQUENCY

390

Tx_f=VAL(I_o$[30;12])

 

400

!

SET WHETHER TO TEST THIS FREQUENCY

410

T_it$=I_o$[56;1]

 

420

!

SET IF THIS IS A PRIME FREQUENCY

430

IF (LEN(I_o$)>57) THEN

 

440Prime$=I_o$[58;1]

450ELSE

460

Prime$=”N”

 

470

END IF

 

480

!

IF THIS FREQUENCY IS TO BE TESTED

8-38

Page 334
Image 334
Agilent Technologies S GSM, 8922M manual Program Example, Program Listing