1 !------------------------------------------------------------------------------ 2 ! 3 ! PROGRAM TAM_IFSW: HP 8562 E-SERIES PASS CONTROL MENU REV A.00.04 4 ! 5 ! REV A.00.04 961002:1548 6 ! Added ability to load and store TAM_CNDTNS file 8 ! REV A.00.03 960816:1130 9 ! Correct screen titles, display same title throughout test. 10 ! Delete reference to (Fx) functionn key numbers in messages. 11 ! 12 ! REV A.00.02 960812:1130 13 ! Add compatibility for 9836 CPU/display. 14 ! Include instrument options in the ID string. 15 ! 16 ! REV A.00.01 960731:0730 17 ! Change program name to TAM Interface Software. 18 ! Show subprogram names in header information. 19 ! Display Hewlett-Packard Co. in header information. 20 ! 21 ! REV A.00.00 960626:0730 22 ! Provides PASS CONTROL to HP8562E Spectrum Analyzers. 23 ! Leveraged from Hewlett-Packard OPVER (VERIFY_6XE, Rev.C.01.00) 24 ! 25 !------------------------------------------------------------------------------ 26 ! 27 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 28 COM /Tam_cndtns/Tam_cndtns$(0:26,1:2)[160] 29 COM /Tests/Tests$(0:128,1:2)[75],Short_name$(1:128)[16] 30 COM /Adj_block/Adj$(0:128,1:2)[75],Adj_name$(1:128)[16] 31 COM /Diag_block/Diag$(0:128,1:2)[75],Diag_name$(1:128)[16] 32 COM /Tam_block/Tam$(0:128,1:2)[75],Tam_name$(1:128)[16] 33 COM /Pass_block/Pass$(0:128,1:2)[75],Pass_name$(1:128)[16] 34 COM /Menu/Menu$[50],Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 35 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 36 ! 37 !---------------------------------------------------------------------------- 38 ! 39 OUTPUT KBD;"K";"GCLEARX";"SCRATCH KEYX";"PRINTER IS CRTX"; 40 CONTROL 2,1;0 ! Printall OFF 41 CONTROL 1,12;2 ! Softkeys ON 42 STATUS KBD,9;Kbd_status 43 IF BIT(Kbd_status,5) AND NOT BIT(Kbd_status,1) THEN CONTROL KBD,15;1 ! Turn compatibility on for HP46020A HIL keyboard 44 Comp$=SYSTEM$("SYSTEM ID") ! Turn display compatibility interface 45 IF Comp$[1,4]="S300" THEN CONTROL CRT,21;0 ! off if computer is 310 46 CONTROL CRT,13;24 ! Force screen to 24 line mode 47 Tam_cndtns_menu ! Call Tam_Cndtns_menu subprogram 48 ! ! which will call Test_menu subprogram 49 ! 50 OUTPUT KBD;"K";"GCLEARX";"MM";!Clr text,graphics,alpha on 51 PRINT TABXY(1,1);"Type RUN to restart the program." 52 ! 53 END 54 ! 55 !----------------------------------------------------------------------------- 56 ! 57 Tam_cndtns_menu: SUB Tam_cndtns_menu ! Set test condition information 58 ! 59 COM /Tam_cndtns/Tam_cndtns$(*) 60 COM /Menu/Menu$[50],Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 61 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 62 ! 63 DIM Mode$[80],File$[80],Key$[160] ! Mode=Key_pressed$&" mode";File$=Sensor file$ 64 DIM Catalog$(1:1000)[80] ! Used to see if mass storage device is present 65 DIM Input$[160] 66 DIM Comp$[7] 67 DIM Default_msus$[160] 68 ! 69 STATUS KBD,9;Kbd_status 70 IF BIT(Kbd_status,5) THEN ! HIL keyboard 71 Ul$=CHR$(132) 72 Clr$=CHR$(128) 73 ELSE 74 Ul$=CHR$(132) 75 Clr$=CHR$(128) 76 END IF 77 ! 78 Comp$=SYSTEM$("SYSTEM ID") ! Select default mass storage file loca- 79 SELECT Comp$[1,4] ! tion based upon the computer being 80 CASE "S300" ! used. 81 Default_msus$=":,700,1" ! The first attempt to load the CONDI- 82 CASE "9816" ! TIONS file will be from the default 83 Default_msus$=":,700,1" ! msus. Refer to Load_conds 84 CASE "9836" 85 Default_msus$=":,700,1" 86 END SELECT 87 ON ERROR CALL Abort_7 88 Default_msus$=SYSTEM$("MSI") 89 OFF ERROR 90 ! 91 ! ------------------------------ LOAD TAM_CNDTNS$(*) ----------------------------- 92 ! 93 RESTORE Tam_cndtns_data ! Read Tam_Cndtns$(*) 94 READ Cond_menu_len ! # of lines in conditions menu 95 REDIM Tam_cndtns$(0:Cond_menu_len,1:2) 96 RESTORE Tam_cndtns_data 97 READ Tam_cndtns$(*) 98 Tam_cndtns$(3,2)=DATE$(TIMEDATE) ! Set current time and date 99 Tam_cndtns$(4,2)=TIME$(TIMEDATE) 100 Init_load_attpt=1 101 GOSUB Load_conds 102 Init_load_attpt=0 103 Compatible_flag=0 104 ! 105 ! -------------------------------- MENU MAIN LOOP -------------------------------- 106 ! 107 REPEAT ! Main menu loop 108 Quit=0 ! Set to 1 to exit program 109 Next_menu=0 ! Set to 1 to go to Test menu 110 Menu$="Main Menu" 111 Draw_alpha_hdr(Menu$) ! Draw Menu graphics header 112 GOSUB Query_dut_sn 113 ! 114 REPEAT ! Key press loop 115 IF Tam_cndtns$(2,2)[5,11]<>"doesn't" THEN 116 Case$="Main" 117 ELSE 118 Case$="No_dut" 119 END IF 120 STATUS KBD,9;Kbd_status 121 IF BIT(Kbd_status,5) THEN 122 Key$="TEST MENU,ADJUST MENU,DIAGNOSMENU,,QUERY DUT,RESTOREDUT ID$,CHANGE ENTRY,LOAD CONDS,STORE CONDS,EXIT," 123 ELSE 124 Key$="TEST MENU,ADJUST MENU,DIAGNOSMENU,,QUERY DUT,RESTOREDUT ID$,CHANGE ENTRY,LOAD CONDS,STORE CONDS,EXIT," 125 END IF 126 Tam_cndtns$(3,2)=DATE$(TIMEDATE) 127 Tam_cndtns$(4,2)=TIME$(TIMEDATE) 128 Tam_cndtns$(6,2)=Ser_num_fname$ 129 Label_keys(Key$,Key_pressed$,Tam_cndtns$(*),Selection,Page) 130 GOSUB Interpret_keys ! Process key selection 131 UNTIL Quit OR Next_menu 132 ! 133 IF Next_menu THEN ! Check for errors before leaving 134 Checking_cond=1 135 Cond_error=0 136 GOSUB Check_model_num ! Check that DUT is a HP8562E 137 Checking_cond=0 138 IF NOT Cond_error THEN ! CALL Test_menu 139 IF Next_menu=1 THEN CALL Test_menu 140 IF Next_menu=2 THEN CALL Adj_menu 141 IF Next_menu=3 THEN CALL Diag_menu 142 END IF 143 END IF 144 ! 145 UNTIL Quit ! Head for the next menu 146 ! 147 KBD CMODE OFF ! Redefine softkeys 148 ! 149 SUBEXIT 150 ! 151 ! -------------------------- Interpret Main Menu SFKs -------------------------- 152 ! 153 Interpret_keys: ! Take action indicated by key press and pointer position 154 Mode$=Ul$&Key_pressed$&" Mode"&RPT$(" ",13-MIN(LEN(Key_pressed$),13))&Clr$ 155 SELECT Key_pressed$ 156 CASE "TEST MENU" ! Go to Test_menu subprogram 157 IF Tam_cndtns$(2,2)[5,11]<>"doesn't" THEN Next_menu=1 158 CASE "ADJUST MENU" ! Go to Adj_menu subprogram 159 IF Tam_cndtns$(2,2)[5,11]<>"doesn't" THEN Next_menu=2 160 CASE "DIAGNOSMENU" ! Go to Diag_menu subprogram 161 IF Tam_cndtns$(2,2)[5,11]<>"doesn't" THEN Next_menu=3 162 CASE "QUERY DUT" ! Attempt to poll DUT 163 GOSUB Query_dut_sn 164 CASE "RESTOREDUT ID$" ! Download original ID string 165 CALL Restore_mod_num 166 CASE "CHANGE ENTRY" ! Permit user to change an selection 167 GOSUB Change_key 168 CASE "LOAD CONDS" 169 GOSUB Load_conds 170 CASE "STORE CONDS" 171 GOSUB Store_conds 172 CASE "EXIT" ! Quit the program 173 Quit=1 174 END SELECT 175 RETURN 176 ! 177 ! ----------------------------- Load Tam_Cndtns Data ----------------------------- 178 ! 179 Load_conds: ! Load conditions data 180 ON ERROR GOTO Lc_no_cond_file 181 DISP "Checking availability of conditions file..." 182 IF Init_load_attpt THEN ! Load from default_msus$ 183 DISP "Loading conditions from ";FNFile$("TAM_CNDTNS",Default_msus$);"..." 184 ASSIGN @Path TO FNFile$("TAM_CNDTNS",Default_msus$) 185 ELSE 186 DISP "Loading conditions from ";FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2));"..." 187 ASSIGN @Path TO FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2)) 188 END IF 189 ENTER @Path;Tam_cndtns$(*) 190 OFF ERROR 191 Tam_cndtns$(3,2)=DATE$(TIMEDATE) ! Set current time and date 192 Tam_cndtns$(4,2)=TIME$(TIMEDATE) 193 RETURN 194 Lc_no_cond_file: ! 195 OFF ERROR 196 IF VAL(Tam_cndtns$(0,1))<>9 THEN ! Tam_Cndtns file is not compatible 197 RESTORE Tam_cndtns_data ! Use defaults instead 198 READ Tam_cndtns$(*) 199 Tam_cndtns$(3,2)=DATE$(TIMEDATE) ! Set current time and date 200 Tam_cndtns$(4,2)=TIME$(TIMEDATE) 201 Tam_cndtns$(2,2)[5,11]="doesn't" ! DUT not responding 202 Prompt_user("WARNING: TAM_CNDTNS file from system file location is not compatible!") 203 END IF 204 IF Init_load_attpt THEN Tam_cndtns$(5,2)=Default_msus$ 205 IF NOT Init_load_attpt THEN CALL Prompt_user("ERROR: Unable to load TAM_CNDTNS file from system file location.") 206 GOSUB Store_conds 207 RETURN 208 ! 209 Store_conds: ! Store Tam_Cndtns$(*) onto file 210 ON ERROR GOTO Sc_no_sys_file 211 DISP "Checking availability of conditions file..." 212 CAT Tam_cndtns$(5,2) TO Catalog$(*) 213 ON ERROR GOTO Sc_create_file 214 ASSIGN @Path TO FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2)) 215 OFF ERROR 216 Output_conditns: DISP "Storing conditions onto ";FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2));"..." 217 OUTPUT @Path;Tam_cndtns$(*) 218 ASSIGN @Path TO * 219 RETURN 220 Sc_create_file:! 221 OFF ERROR 222 ON ERROR GOTO 229 223 CREATE BDAT FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2)),9,256 224 ASSIGN @Path TO FNFile$("TAM_CNDTNS",Tam_cndtns$(5,2)) 225 GOTO Output_conditns 226 Sc_no_sys_file:! 227 OFF ERROR 228 Prompt_user("ERROR: System mass storage file location catalog cannot be read.") 229 RETURN 230 ! 231 ! ----------------------------------- QUERY DUT ---------------------------------- 232 ! 233 Query_dut_sn: ! 234 ! 235 PRINT TABXY(3,5),"Standby, I'm polling the Spectrum Analyzer for an ID string ..." 236 IF POS(Tam_cndtns$(1,2),"NA") THEN ! DUT HPIB address location 237 Tam_cndtns$(2,2)="No HPIB address listed for DUT" 238 IF Checking_cond THEN CALL Prompt_user("ERROR: No HPIB address listed for DUT",Cond_error) 239 ELSE 240 Full_address=VAL(Tam_cndtns$(1,2)) 241 Select_code=INT(Full_address/100) 242 ON ERROR GOTO Nothing_there 243 LOCAL Select_code 244 REMOTE Select_code 245 OFF ERROR 246 Address=Full_address MOD 100 247 ON TIMEOUT Select_code,1 GOTO Nothing_there 248 ASSIGN @Dut TO Full_address 249 OUTPUT @Dut;"IP" 250 WAIT 2 251 OUTPUT @Dut;"ID?" 252 ENTER @Dut;Model_num$ 253 ! 254 OUTPUT @Dut;"SER?" 255 ENTER @Dut;Serial_num$ 256 IF Model_num$[1,7]<>"HP8562E" THEN GOSUB Check_model_num 257 OFF TIMEOUT 258 Tam_cndtns$(2,2)=Model_num$[1,7]&" "&Serial_num$ 259 ! 260 Last_ser=LEN(Serial_num$) ! Write ID string to file DUTXXXXX 261 Ser_num_fname$=Model_num$[1,2]&Model_num$[5,7]&Serial_num$[Last_ser-4,Last_ser] 262 ON ERROR GOTO Already_exists 263 CREATE ASCII Ser_num_fname$,1 264 Already_exists: OFF ERROR 265 ASSIGN @Store_model TO Ser_num_fname$ 266 OUTPUT @Store_model;Model_num$ 267 ASSIGN @Store_model TO * 268 ! 269 RETURN 270 ! 271 Check_model_num: ! 272 IF Model_num$[1,7]<>"HP8562E" THEN 273 Cond_error=1 274 DISP "ERROR: Wrong model number returned. Attempting to correct." 275 Model_num$[1,7]="HP8562E" 276 Result=FNWrite_mod_num(Model_num$) 277 DISP 278 END IF 279 RETURN 280 ! 281 Nothing_there: ! 282 Tam_cndtns$(2,2)="DUT doesn't respond at bus address" 283 Tam_cndtns$(2,2)[5,11]="doesn't" 284 IF Checking_cond THEN CALL Prompt_user("ERROR: DUT doesn't respond at address listed.",Cond_error) 285 END IF 286 RETURN 287 ! 288 ! ------------------- Process Changes in the Tam_Cndtns Menu ---------------------- 289 ! 290 Change_key: ! Change selection pointed to 291 ON ERROR GOTO Entry_error ! Blanket error trapping command 292 IF Selection=1 THEN GOSUB Change_address ! HPIB addresses 293 IF Selection=3 THEN GOSUB Change_date ! System date 294 IF Selection=4 THEN GOSUB Change_time ! System time 295 IF Selection=5 THEN GOSUB Change_file ! System mass storage file 296 OFF ERROR ! ON ERROR GOTO entry_error 297 RETURN ! from Change_key 298 ! 299 Change_date: ! 300 DISP "Enter new system date (dd mmm yyyy):"; 301 Input$=Tam_cndtns$(3,2) 302 Input(Input$) 303 IF Input$<>"" THEN 304 Time=TIMEDATE MOD 86400 305 SET TIMEDATE DATE(Input$) 306 SET TIME (Time) 307 Tam_cndtns$(3,2)=DATE$(TIMEDATE) 308 END IF 309 RETURN 310 ! 311 Change_time: ! 312 DISP "Enter new system time (hh:mm:ss):"; 313 Input$=Tam_cndtns$(4,2) 314 Input(Input$) 315 IF Input$<>"" THEN 316 SET TIME TIME(Input$) 317 Tam_cndtns$(4,2)=TIME$(TIMEDATE) 318 END IF 319 RETURN 320 ! 321 Change_file: ! system mass storage file 322 DISP "Enter mass storage file location"; 323 Input$=Tam_cndtns$(5,2) 324 Input(Input$) 325 IF Input$<>"" THEN 326 Input$=Input$[1,160] 327 ON ERROR GOTO Bad_file 328 DISP 329 DISP "Checking availability of mass storage file..." 330 CAT Input$ TO Catalog$(*) 331 Tam_cndtns$(5,2)=Input$ 332 END IF 333 RETURN 334 ! 335 Bad_file: Prompt_user("ERROR: Unable to obtain catalog from """&Input$&""".") 336 RETURN 337 ! 338 Change_address: ! Change HPIB addresses 339 Address_ok=1 340 Full_address=-1 341 I$=Tam_cndtns$(Selection,2) 342 DISP "Enter new HPIB address (select code plus address): "; 343 Input(I$) 344 IF LEN(I$)=0 OR POS(I$,"NA") THEN I$="0" 345 Full_address=VAL(I$) 346 IF Full_address=-1 THEN RETURN 347 IF Full_address=0 THEN 348 Tam_cndtns$(Selection,2)=" NA " 349 ELSE 350 Select_code=MIN(99,INT(Full_address/100)) 351 Address=Full_address MOD 100 352 ON ERROR GOTO Bad_select_code 353 LOCAL Select_code 354 REMOTE Select_code 355 GOTO Check_address 356 Bad_select_code: ! 357 Address_ok=0 358 Prompt_user("ERROR: Select code "&VAL$(Select_code)&" does not currently support HP-IB operations.") 359 Check_address:! 360 IF Address<0 OR Address>30 THEN 361 Address_ok=0 362 Prompt_user("ERROR: Address must be from 0 to 30 inclusive.") 363 END IF 364 IF Address_ok THEN 365 OUTPUT Tam_cndtns$(Selection,2) USING "#,4D,K";Full_address,"" 366 END IF 367 END IF 368 RETURN 369 ! 370 Entry_error: ! 371 Prompt_user("ERROR: Data not accepted, check entry format.") 372 RETURN 373 ! 374 ! ------------ Main Menu Tam_Cndtns$(*) and Test_Tam_Cndtns$(*) Data ------------- 375 ! 376 Tam_cndtns_data: ! 377 DATA 6,1 ! Number of lines, pages 378 DATA "Spectrum Analyzer polling address ..... "," 718 " 379 DATA "Spectrum Analyzer ID string ........... ","HP8562E" 380 DATA "Date .................................. ","31 May 1996" 381 DATA "Time .................................. ","12:12:12" 382 DATA "System mass storage file location ..... ",":CS80, 703" 383 DATA "Device Under Test Data File ........... ","HP62E00001" 384 ! 385 SUBEND 386 ! 387 ! ---------------------------------- TEST MENU ----------------------------------- 388 ! 389 Test_menu: SUB Test_menu !Selects a test and test mode 390 ! 391 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 392 COM /Tam_cndtns/Tam_cndtns$(*) 393 COM /Tests/Tests$(*),Short_name$(*) 394 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 395 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 396 ! 397 DIM Key_title$[160],Mode$[80],Test_link$[3000],Working_link$[160] 398 ! 399 Last_test=0 ! Reset last_test when entering menu 400 Sequence_type=1 ! Set flag to turn-on compatibility list 401 STATUS KBD,9;Kbd_status 402 IF BIT(Kbd_status,5) THEN ! HIL keyboard 403 Ul$=CHR$(132) 404 Clr$=CHR$(128) 405 ELSE 406 Ul$=CHR$(132) 407 Clr$=CHR$(128) 408 END IF 409 ! 410 ! ------------------------------ Load Test Menu Data ----------------------------- 411 ! 412 READ Tests$(0,1),Tests$(0,2) ! Num entries, pages 413 FOR I=1 TO VAL(Tests$(0,1)) 414 READ Tests$(I,1),Short_name$(I),Tests$(I,2) 415 NEXT I 416 ! 417 ! 418 ! ------------------------------ Test Menu Main Loop ----------------------------- 419 ! 420 REPEAT ! 421 Menu$="Test Menu" 422 Draw_alpha_hdr(Menu$) 423 Case$="Test" 424 STATUS KBD,9;Kbd_status 425 IF BIT(Kbd_status,5) THEN ! HP46020A keyboard 426 Key_title$="SELECT,,,,,,,,,MAIN MENU," 427 ELSE 428 Key_title$="SELECT,,,,,,,,,MAIN MENU," 429 END IF 430 Page=1+(Test_number>14) 431 Compatible_flag=-1 432 Label_keys(Key_title$,Key_pressed$,Tests$(*),Test_number,Page) ! Write page and label soft keys 433 Compatible_flag=0 434 GOSUB Inter_test_keys ! Decode key press selection 435 UNTIL Quit ! Abort key exits this loop by 436 SUBEXIT ! setting Quit to 1 437 ! 438 ! --------------------------- Interpret Test Menu SFKs --------------------------- 439 ! 440 Inter_test_keys: ! Decodes selection and mode and calls proper routines 441 ! 442 SELECT Key_pressed$ ! The name of the key pressed 443 CASE "SELECT" 444 Next_menu=5 445 Test_name$=Tests$(Test_number,1) 446 Trick_model_num$=Short_name$(Test_number) 447 CALL Tam_wrapper 448 CASE "MAIN MENU" 449 Quit=1 450 END SELECT 451 RETURN 452 ! 453 ! 454 ! -------------------------------- Test Menu Data -------------------------------- 455 ! 456 Test_data: DATA 16,2 ! Test_name$, Trick_model_num$, Special_cond$ 457 DATA "1) Noise Sidebands ","HP8560E","" 458 DATA "2) Residual FM ","HP8560E","" 459 DATA "3) IF Gain Uncertainty ","HP8560E","" 460 DATA "4) Scale Fidelity ","HP8560E","" 461 DATA "5) Input Attenuator Accuracy ","HP8560E","" 462 DATA "6) Frequency Marker Accuracy ","HP8561E","" 463 DATA "7) Image, Multi, Out-of-Band Resp ","HP8561E","" 464 DATA "8) Res BW Accy & Selectivity ","HP8560E","" 465 DATA "9) 2nd Harmonic Distortion ","HP8560E"," Tests to looser specs." 466 DATA "10) Frequency Span Accuracy ","HP8560E","" 467 DATA "11) Gain Compression ","HP8560E","" 468 DATA "12) T.O.I. ","HP8560E"," Tests to looser specs." 469 DATA "13) Frequency Response ","HP8561E"," NOT AVAILABLE" 470 DATA "14) 1st LO OUTPUT Amplitude ","HP8561E","" 471 DATA "15) Displayed Average Noise Level ","HP8561E"," Tests to 6.5 GHz & looser specs." 472 DATA "16) Residual Responses ","HP8561E","" 473 ! 474 SUBEND 475 ! 476 ! 477 ! ---------------------------------- LABEL KEYS ------------------------------------ 478 ! 479 Label_keys: SUB Label_keys(Label$,Key_pressed$,Page_info$(*),Pointer,Page) 480 ! 481 ! Labels the softkeys according to Label$, which is in the form: 482 ! "Keys_name1,...,Key_name10," 483 ! Returns the literal name of the softkey selected in Key_pressed$ 484 ! Prints an array of selections held in Page_info$ (Tam_Cndtns or 485 ! Test menu). Page_info$(0,1) = # of lines. Page_info$(0,2) = 486 ! # of pages (10 lines/page). Page_info$(1:# lines) is 37 487 ! characters long. 488 ! Pointer keeps track of the line in Page_info$(*) a pointer is set to. 489 ! 490 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 491 COM /Tests/Tests$(*),Short_name$(*) 492 COM /Adj_block/Adj$(*),Adj_name$(*) 493 COM /Diag_block/Diag$(*),Diag_name$(*) 494 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 495 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 496 DIM Defined(0:15),Key_label$(0:11)[14],Kbd_buffer$[200] 497 ! 498 Offset=4 ! First line of Page_info$(*) is printed 5 lines from top 499 Num_entries=VAL(Page_info$(0,1)) ! Length of Page_info$(*) 500 Delta_page=9 ! SH arrow keys move ptr 10 lines 501 Total_pages=VAL(Page_info$(0,2)) ! Total pages in Page_info$(*) 502 Items_per_page=MIN(9,Num_entries) 503 Pointer=MIN(MAX(1,Pointer),Num_entries)! Ensure pointer is in range 504 Page=MIN(MAX(1,Page),Total_pages) ! Set correct page 505 Point=Pointer-(9*(Page-1))+Offset ! Line # for TABXY function 506 ! 507 ON KBD ALL GOSUB Read_keyboard ! Read keyboard entries 508 GOSUB Wrt_softkeys ! Write special function keys 509 GOSUB Write_new_page ! Write page 510 GOSUB Wrt_pointer ! Write the pointer indicator 511 ! 512 CALL Instructions(Case$) ! Get user messages 513 Clear: Keyboard$="" 514 Wait: ! 515 IF Page_info$(3,1)[1,4]="Date" THEN 516 Page_info$(3,2)=DATE$(TIMEDATE) 517 Page_info$(4,2)=TIME$(TIMEDATE) 518 IF Page=1 THEN 519 PRINT TABXY(45,7);Page_info$(3,2) 520 PRINT TABXY(45,8);Page_info$(4,2) 521 END IF 522 END IF 523 IF LEN(Keyboard$)=0 THEN Wait ! Wait for a key press 524 Softkey=POS("0123456789^VWT",Keyboard$[2,2])-1!SFK0-9,up,down,shup,shdn 525 IF Softkey=14 THEN ! CNTL key pressed 526 Softkey=POS("WT",Keyboard$[3,3])-1 ! CNTL-SHIFT up & down arrow 527 IF Softkey>=0 THEN Softkey=Softkey+14 ! Valid CNTL key pressd 528 END IF 529 IF Softkey=-1 THEN Clear ! Undefined key pressed 530 IF (Softkey>9) THEN ! Motion of 1 to 6 indicates 531 Motion=Softkey-9 ! up,down,pageup,pagedown,top page, middle of pages 532 GOSUB Position_point ! Set new pointer position 533 GOSUB Wrt_pointer ! Print the pointer 534 END IF 535 IF NOT Defined(Softkey) THEN Clear ! Ignore undefined softkeys and 536 Key_pressed$=Key_label$(Softkey) ! don't exit subprogram 537 Pointer=(Delta_page*(Page-1))+(Point)-Offset ! Set pointer based on Page 538 SUBEXIT ! and Point 539 ! 540 Wrt_softkeys: ! Write the softkeys 541 FOR Key=0 TO 9 542 Comma=POS(Label$,",") 543 Key_label$(Key)=Label$[1,Comma-1] ! Parse out next label 544 Label$=Label$[Comma+1] 545 Defined(Key)=(Key_label$(Key)<>"") ! Does key have non-blank def.? 546 ON KEY Key LABEL Key_label$(Key) GOSUB Ignore 547 NEXT Key 548 RETURN 549 ! 550 Position_point: ! Determine a new pointer pos. 551 IF Motion=1 THEN Point=Point-1 ! Up 552 IF Motion=2 THEN Point=Point+1 ! Down 553 IF Motion=3 THEN Page=MAX(1,Page-1) ! Page up 554 IF Motion=4 THEN Page=MIN(Total_pages,Page+1) ! Page down 555 IF Motion=4 THEN Point=MIN(Point,Num_entries-(Page-1)*Delta_page+Offset) ! Make sure you don't go beyond last test 556 IF Motion=5 THEN Page=1 ! Top page 557 IF Motion=5 THEN Point=Offset+1 558 IF Motion=6 THEN Page=MIN(5,Total_pages) ! Page 2 (Tam_Cndtns menu) or Page 5 (HF sequence on Tests menu) 559 IF Motion=6 THEN Point=Offset+1 560 ! 561 IF Motion<=2 THEN GOSUB Check_position ! Up or Down 562 IF Motion>=3 THEN GOSUB Write_new_page ! Have possibly jumped a page 563 RETURN 564 ! 565 Check_position: ! Determine what needs to be changed from new pos. 566 Change_page=0 567 IF Point1 ! Change the page if page > 1 569 Page=MAX(1,Page-1) ! Determine new page # 570 IF Change_page THEN Point=Delta_page+Offset ! If Change page at top, 571 IF NOT Change_page THEN Point=Offset+1 ! otherwise Move point by 0 572 END IF 573 ! 574 IF (Point-Offset)>Items_per_page OR (Page-1)*Delta_page+Point-Offset>Num_entries THEN ! Off end page or past last entry 575 Change_page=Page" ! Write new pointer 611 Last_point=Point 612 RETURN 613 ! 614 SUBEND ! Label_keys 615 ! 616 ! 617 Write_page: SUB Write_page(Page_info$(*),Page) 618 ! 619 ! Writes page # Page of Page_info$(*). Assumes pages are 9 lines long, 620 ! but that each page starts at 9 line intervals. Thus, page 3 consists 621 ! of lines 19-27 of Page_info$(*). 622 ! 623 DIM M$(1:128)[7],T$[45] 624 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 625 COM /Tests/Tests$(*),Short_name$(*) 626 COM /Adj_block/Adj$(*),Adj_name$(*) 627 COM /Diag_block/Diag$(*),Diag_name$(*) 628 ! 629 Offset=5 630 PRINT TABXY(1,Offset); 631 FOR Item=Page*9-8 TO Page*9 ! For items on the page 632 T$="" 633 IF Item>VAL(Page_info$(0,1)) THEN Item_len=0 634 IF Item<=VAL(Page_info$(0,1)) THEN Item_len=LEN(Page_info$(Item,2)) 635 IF Item<=VAL(Page_info$(0,1)) AND Item_len<=45 THEN T$=Page_info$(Item,2) 636 IF Compatible_flag=-1 THEN 637 IF Sequence_type=1 THEN M$(Item)=Short_name$(Item) 638 IF Sequence_type=2 THEN M$(Item)=Adj_name$(Item) 639 IF Sequence_type=3 THEN M$(Item)=Diag_name$(Item) 640 ELSE 641 M$(Item)="" 642 END IF 643 IF Item<=VAL(Page_info$(0,1)) AND Item_len>45 THEN 644 T$[1,17]=Page_info$(Item,2)[1,17] 645 T$=T$&"..."&Page_info$(Item,2)[(Item_len-16),Item_len] 646 END IF 647 IF Item>VAL(Page_info$(0,1)) THEN PRINT RPT$(" ",80) 648 IF Item<=VAL(Page_info$(0,1)) THEN PRINT " ";Page_info$(Item,1);" ";M$(Item);T$;RPT$(" ",MAX(0,34-LEN(Page_info$(Item,2)))) 649 NEXT Item 650 SUBEND !Write_page 651 ! 652 ! 653 Sensor_file: DEF FNSensor_file$(Sensor_type,Sensor_sn) 654 ! 655 COM /Tam_cndtns/Tam_cndtns$(*) 656 ! 657 DIM File$[80],Msi$[80],Units$[6],Test$[2] 658 ! 659 OUTPUT File$ USING "#,K,DD,5Z";"SEN",Sensor_type,Sensor_sn 660 RETURN FNFile$(File$,Tam_cndtns$(5,2)) 661 ! 662 FNEND 663 ! 664 ! 665 Parse: SUB Parse(Input$,Return$,OPTIONAL Value) 666 ! 667 ! Take the Input$, return in Return$ all characters up to an "=" or ",", 668 ! return in Value the numeric value of the characters from "=" to ",", 669 ! and return in Input$ all characters after the ",". 670 ! 671 IF NPAR=3 THEN Value=-999 672 IF POS(Input$,",") THEN 673 Return$=Input$[1,POS(Input$,",")-1] ! All characters up to a "," 674 Input$=Input$[POS(Input$,",")+1] ! All characters after a "," 675 ELSE ! No "," present 676 Return$=Input$ 677 Input$="" 678 END IF 679 IF POS(Return$,"=") THEN 680 Value=VAL(Return$[POS(Return$,"=")+1]) ! Characters after "=" 681 Return$=Return$[1,POS(Return$,"=")-1] ! Stip characters after "=" 682 END IF 683 ! 684 SUBEND 685 ! 686 ! 687 File: DEF FNFile$(File$,Msi$) 688 ! 689 DIM Path$[80] 690 Path$="" 691 ! Remote_pos=POS(Msi$,":REMOTE") 692 ! IF Remote_pos OR POS(Msi$&File$,"/") THEN 693 ! IF Remote_pos THEN 694 ! RETURN Msi$[1,Remote_pos-1]&"/"&File$&Msi$[Remote_pos] 695 ! ELSE 696 ! RETURN Msi$&"/"&File$ 697 ! END IF 698 ! ELSE 699 ! RETURN File$&Msi$ 700 ! END IF 701 Colon_pos=POS(Msi$,":") 702 SELECT Colon_pos 703 CASE 0 ! Only path specified, no msus; use default msus 704 RETURN Msi$&"/"&File$ 705 CASE 1 ! No path specified; append Msi$ to File$ 706 RETURN File$&Msi$ 707 CASE >1 ! Path and msus specified; put File$ in between 708 Path$=Msi$[1,Colon_pos-1] 709 IF Path$[Colon_pos-1;1]="/" THEN ! Don't need to add another "/" 710 RETURN Path$&File$&Msi$[Colon_pos] 711 ELSE ! Add additional "/" 712 RETURN Path$&"/"&File$&Msi$[Colon_pos] 713 END IF 714 END SELECT 715 ! 716 FNEND 717 ! 718 ! ---------------------------------- DRAW HEADER ----------------------------------- 719 ! 720 Draw_alpha_hdr: SUB Draw_alpha_hdr(Label$) ! Draw Label$ on header 721 ! 722 COM /Tam_cndtns/Tam_cndtns$(*) 723 DIM Line1_text$[80] 724 DIM Line2_text$[80] 725 DIM Line3_text$[80] 726 DIM Line4_text$[80] 727 DIM In_text$[80] 728 DIM Out_text$[80] 729 DIM Ruler1$[80] 730 DIM Ruler2$[80] 731 Ruler2$="12345678901234567890123456789012345678901234567890123456789012345678901234567890" 732 Ruler1$="00000000011111111112222222222333333333344444444445555555555666666666677777777778" 733 ! 734 STATUS KBD,9;Kbd_status 735 IF BIT(Kbd_status,5) THEN 736 Ul$=CHR$(132) 737 Clr$=CHR$(128) 738 ELSE 739 Ul$=CHR$(132) 740 Clr$=CHR$(128) 741 END IF 742 ! 743 OUTPUT KBD;"K"; 744 Line2_text$="HP 8562E/TAM INTERFACE SOFTWARE" 745 Line3_text$=Label$ 746 Line4_text$=Ul$&"Copyright Hewlett-Packard Co. 1996 Rev. A.00.04"&Clr$ 747 PRINT TABXY(2,1),RPT$("_",78) 748 PRINT TABXY(1,2),"|",TABXY(80,2),"|" 749 PRINT TABXY(1,3),"|",TABXY(80,3),"|" 750 PRINT TABXY(1,4),"|",TABXY(80,4),"|" 751 PRINT TABXY(2,4);Ul$&RPT$(" ",78)&Clr$ 752 In_text$=Line2_text$ 753 GOSUB Expand_print 754 Menu_len=LEN(Out_text$) 755 Start_pos=40-Menu_len/2 756 PRINT TABXY(Start_pos,2),Out_text$ 757 In_text$=Line3_text$ 758 GOSUB Expand_print 759 Menu_len=LEN(Out_text$) 760 Start_pos=40-Menu_len/2 761 PRINT TABXY(Start_pos,3),Out_text$ 762 PRINT TABXY(2,4),Line4_text$ 763 SUBEXIT 764 ! 765 Expand_print: ! 766 Out_text$="" 767 Input_length=LEN(In_text$) 768 IF Input_length>40 THEN RETURN ! Don't expand print if it will exceed 80 characters 769 FOR I=1 TO Input_length 770 Out_text$=Out_text$&In_text$[I;1]&" " 771 NEXT I 772 RETURN 773 ! 774 SUBEND !Draw_alpha_hdr 775 ! 776 ! 777 SUB Adj_menu 778 ! -------------------------------- ADJUSTMENTS MENU -------------------------------- 779 ! 780 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 781 COM /Tam_cndtns/Tam_cndtns$(*) 782 COM /Adj_block/Adj$(*),Adj_name$(*) 783 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 784 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 785 ! 786 DIM Key_title$[160],Mode$[80],Test_link$[3000],Working_link$[160] 787 ! 788 Last_test=0 ! Reset last_test when entering menu 789 Sequence_type=2 ! Set flag to turn-on compatibility list 790 STATUS KBD,9;Kbd_status 791 IF BIT(Kbd_status,5) THEN ! HIL keyboard 792 Ul$=CHR$(132) 793 Clr$=CHR$(128) 794 ELSE 795 Ul$=CHR$(132) 796 Clr$=CHR$(128) 797 END IF 798 ! 799 ! 800 ! --------------------------- Load Adjustments List ----------------------------- 801 ! 802 READ Adj$(0,1),Adj$(0,2) ! Num entries, pages 803 FOR I=1 TO VAL(Adj$(0,1)) 804 READ Adj$(I,1),Adj_name$(I),Adj$(I,2) 805 NEXT I 806 ! 807 ! ------------------------- Adjustments Menu Main Loop -------------------------- 808 ! 809 REPEAT ! 810 Menu$="Adjustments Menu" 811 Draw_alpha_hdr(Menu$) 812 Case$="Adjust" 813 STATUS KBD,9;Kbd_status 814 IF BIT(Kbd_status,5) THEN ! HP46020A keyboard 815 Key_title$="SELECT,,,,,,,,,MAIN MENU," 816 ELSE 817 Key_title$="SELECT,,,,,,,,,MAIN MENU," 818 END IF 819 Page=1+(Test_number>14) 820 Compatible_flag=-1 821 Label_keys(Key_title$,Key_pressed$,Adj$(*),Test_number,Page) ! Write page and label soft keys 822 Compatible_flag=0 823 GOSUB Inter_adj_keys ! Decode key press selection 824 UNTIL Quit ! Abort key exits this loop by 825 SUBEXIT ! setting Quit to 1 826 ! 827 ! ------------------------- Interpret Adjustments Menu SFKs --------------------- 828 ! 829 Inter_adj_keys: ! Decodes selection and mode and calls proper routines 830 ! 831 SELECT Key_pressed$ ! The name of the key pressed 832 CASE "SELECT" 833 Next_menu=5 834 Test_name$=Adj$(Test_number,1) 835 Trick_model_num$=Adj_name$(Test_number) 836 CALL Tam_wrapper 837 CASE "MAIN MENU" 838 Quit=1 839 END SELECT 840 RETURN 841 ! 842 ! ------------------------------- Adjustments Data ------------------------------- 843 ! 844 Adj_data: DATA 15,2 ! Test_name$, Trick_model_num$, Special_cond$ 845 DATA "1) IF Bandpass - LC Poles ","HP8561E","" 846 DATA "2) IF Bandpass - Crystal Poles ","HP8561E","" 847 DATA "3) IF Bandpass - Amplitude ","HP8561E","" 848 DATA "4) Limiter Phase ","HP8561E","" 849 DATA "5) Linear Fidelity ","HP8561E","" 850 DATA "6) Log Fidelity ","HP8561E","" 851 DATA "7) Sampling Oscillator ","HP8561E","" 852 DATA "8) YTO ","HP8563E","" 853 DATA "9) LO Distribution Amplifier ","HP8563E","" 854 DATA "10) Low Band Flatness ","HP8561E"," NOT AVAILABLE" 855 DATA "11) High Band Flatness & YTF ","HP8561E"," NOT AVAILABLE" 856 DATA "12) Calibrator Amplitude ","HP8561E","" 857 DATA "13) 10 MHz Reference Oscillator ","HP8561E","" 858 DATA "14) External Mixer Bias ","HP8561E","" 859 DATA "15) External Mixer Amplitude ","HP8561E","" 860 ! 861 SUBEND 862 ! 863 ! -------------------------------- DIAGNOSTICS MENU -------------------------------- 864 ! 865 SUB Diag_menu 866 ! 867 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 868 COM /Tam_cndtns/Tam_cndtns$(*) 869 COM /Diag_block/Diag$(*),Diag_name$(*) 870 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 871 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 872 ! 873 DIM Key_title$[160],Mode$[80],Test_link$[3000],Working_link$[160] 874 ! 875 Last_test=0 ! Reset last_test when entering Test_menu 876 Sequence_type=3 ! Set flag to turn-on compatibility list 877 STATUS KBD,9;Kbd_status 878 IF BIT(Kbd_status,5) THEN ! HIL keyboard 879 Ul$=CHR$(132) 880 Clr$=CHR$(128) 881 ELSE 882 Ul$=CHR$(132) 883 Clr$=CHR$(128) 884 END IF 885 ! 886 ! 887 ! --------------------------- Load Diagnostics List ----------------------------- 888 ! 889 READ Diag$(0,1),Diag$(0,2) ! Num entries, pages 890 FOR I=1 TO VAL(Diag$(0,1)) 891 READ Diag$(I,1),Diag_name$(I),Diag$(I,2) 892 NEXT I 893 ! 894 ! ------------------------- Diagnostics Menu Main Loop -------------------------- 895 ! 896 REPEAT ! Main menu loop 897 Quit=0 ! Set to 1 to exit program 898 Next_menu=0 ! Set to 1 to go to Test menu 899 Menu$="Diagnostics Menu" 900 Draw_alpha_hdr(Menu$) ! Draw Menu graphics header 901 ! 902 REPEAT ! Key press loop 903 Case$="Diagnostic" 904 STATUS KBD,9;Kbd_status 905 IF BIT(Kbd_status,5) THEN 906 Key_title$="SELECT,,,,,,,,,MAIN MENU," 907 ELSE 908 Key_title$="SELECT,,,,,,,,,MAIN MENU," 909 END IF 910 Page=1+(Test_number>14) 911 Compatible_flag=-1 912 Label_keys(Key_title$,Key_pressed$,Diag$(*),Test_number,Page) ! Write page and label soft keys 913 Compatible_flag=0 914 GOSUB Inter_diag_keys ! Process key selection 915 UNTIL Quit OR Next_menu 916 ! 917 IF Next_menu THEN ! Check for errors before leaving 918 Checking_cond=1 919 Cond_error=0 920 Checking_cond=0 921 IF NOT Cond_error THEN 922 IF Next_menu=5 THEN CALL Tam_wrapper 923 END IF 924 END IF 925 ! 926 UNTIL Quit ! Head for the next menu 927 SUBEXIT ! setting Quit to 1 928 ! 929 ! ------------------------- Interpret Diagnostics Menu SFKs --------------------- 930 ! 931 Inter_diag_keys: ! Decodes selection and mode and calls proper routines 932 ! 933 SELECT Key_pressed$ ! The name of the key pressed 934 CASE "SELECT" 935 Next_menu=5 936 Test_name$=Diag$(Test_number,1) 937 Trick_model_num$=Diag_name$(Test_number) 938 CASE "MAIN MENU" 939 Quit=1 940 END SELECT 941 RETURN 942 ! 943 ! ------------------------------- Diagnostics Data ------------------------------- 944 ! 945 Diag_data: DATA 8,1 ! Test_name$, Trick_model_num$, Special_cond$ 946 DATA "1) Automatic Fault Isolation ","HP8561E","" 947 DATA "2) Manual Probe Troubleshooting ","HP8563E","" 948 DATA "3) RF Path Fault Isolation ","HP8561E"," Checks up to 5 GHz." 949 DATA "4) Cal Osc Troubleshooting Mode ","HP8561E","" 950 DATA "5) TAM 8 Channel Voltmeter ","HP8561E","" 951 DATA "6) TAM Output Signal Test ","HP8561E","" 952 DATA "7) TAM Connector Address Test ","HP8561E","" 953 DATA "8) TAM Calibration ","HP8561E","" 954 ! 955 SUBEND 956 ! 957 ! ------------------------ TAM MAIN MENU WRITE NEW ID STRING ----------------------- 958 ! 959 SUB Tam_wrapper 960 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 961 COM /Tam_cndtns/Tam_cndtns$(*) 962 COM /Tam_block/Tam$(*),Tam_name$(*) 963 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 964 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 965 ! 966 DIM Key_title$[160],Mode$[80],Test_link$[3000],Working_link$[160] 967 ! 968 Last_test=0 ! Reset last_test when entering Test_menu 969 STATUS KBD,9;Kbd_status 970 IF BIT(Kbd_status,5) THEN ! HIL keyboard 971 Ul$=CHR$(132) 972 Clr$=CHR$(128) 973 ELSE 974 Ul$=CHR$(132) 975 Clr$=CHR$(128) 976 END IF 977 ! 978 ! 979 ! ----------------------------------- TAM List ----------------------------------- 980 ! 981 READ Tam$(0,1),Tam$(0,2) ! Num entries, pages 982 FOR I=1 TO VAL(Tam$(0,1)) 983 READ Tam$(I,1),Tam_name$(I),Tam$(I,2) 984 NEXT I 985 Tam$(1,2)=Serial_num$ 986 Tam$(2,2)=Test_name$ 987 Tam$(3,2)=Trick_model_num$ 988 ! 989 ! ------------------------------- TAM Menu Main Loop ----------------------------- 990 ! 991 REPEAT ! Main menu loop 992 Quit=0 ! Set to 1 to exit program 993 Next_menu=0 ! Set to 1 to go to Test menu 994 IF Sequence_type=1 THEN Menu$="Test Menu" 995 IF Sequence_type=2 THEN Menu$="Adjustments Menu" 996 IF Sequence_type=3 THEN Menu$="Diagnostics Menu" 997 Draw_alpha_hdr(Menu$) ! Draw Menu graphics header 998 ! 999 REPEAT ! Key press loop 1000 Case$="Write_id" 1001 STATUS KBD,9;Kbd_status 1002 IF BIT(Kbd_status,5) THEN 1003 Key_title$="WRITE NEW ID$,,,,,,,,,SELECT MENU," 1004 ELSE 1005 Key_title$="WRITE NEW ID$,,,,,,,,,SELECT MENU," 1006 END IF 1007 Page=1+(Test_number>14) 1008 Label_keys(Key_title$,Key_pressed$,Tam$(*),Test_number,Page) ! Write page and label soft keys 1009 GOSUB Inter_tam_keys ! Process key selection 1010 UNTIL Quit OR Next_menu 1011 ! 1012 IF Next_menu THEN ! Check for errors before leaving 1013 Checking_cond=1 1014 Cond_error=0 1015 Checking_cond=0 1016 IF NOT Cond_error THEN ! Return to calling menu 1017 ! 1018 IF Next_menu=6 THEN CALL Pass_cntl 1019 ! 1020 Quit=1 1021 END IF 1022 END IF 1023 ! 1024 UNTIL Quit ! Head for the next menu 1025 SUBEXIT ! setting Quit to 1 1026 ! 1027 ! ---------------------------- Interpret TAM Menu SFKs --------------------------- 1028 ! 1029 Inter_tam_keys: ! Decodes selection and mode and calls proper routines 1030 ! 1031 SELECT Key_pressed$ ! The name of the key pressed 1032 CASE "WRITE NEW ID$" 1033 Next_menu=6 1034 CASE "SELECT MENU" 1035 Quit=1 1036 END SELECT 1037 RETURN 1038 ! 1039 ! ------------------------------- TAM Screen Data -------------------------------- 1040 ! 1041 Tam_data: DATA 3,1 ! 1042 DATA "SPECTRUM ANALYZER Serial Number:...","","" 1043 DATA "User selected TAM function is:.....","","" 1044 DATA "New ID String to send analyzer:....","","" 1045 ! 1046 SUBEND 1047 ! 1048 ! ---------------------------- PASS CONTROL ROUTINE ------------------------------ 1049 ! 1050 ! This subroutine passes control to the HPIB device and waits for the operator to 1051 ! request pass control back to the computer by pressing the softkey. Added for the 1052 ! HP 8562E Spectrum Analyzer TAM Interface Software. 1053 ! 1054 SUB Pass_cntl 1055 ! 1056 COM /Test_flags/Test_number,Sequence_type,Last_test,Compatible_flag 1057 COM /Tam_cndtns/Tam_cndtns$(*) 1058 COM /Tests/Tests$(*),Short_name$(*) 1059 COM /Adj_block/Adj$(*),Adj_name$(*) 1060 COM /Diag_block/Diag$(*),Diag_name$(*) 1061 COM /Pass_block/Pass$(*),Pass_name$(*) 1062 COM /Menu/Menu$,Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 1063 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 1064 ! 1065 DIM Key_title$[160],Mode$[80],Test_link$[3000],Working_link$[160] 1066 ! 1067 Last_test=0 ! Reset last_test when entering menu 1068 Compatible_flag=0 ! Disable display of compatible tests 1069 STATUS KBD,9;Kbd_status 1070 IF BIT(Kbd_status,5) THEN ! HIL keyboard 1071 Ul$=CHR$(132) 1072 Clr$=CHR$(128) 1073 ELSE 1074 Ul$=CHR$(132) 1075 Clr$=CHR$(128) 1076 END IF 1077 ! 1078 ! 1079 ! ---------------------------------- PASS List ----------------------------------- 1080 ! 1081 READ Pass$(0,1),Pass$(0,2) ! Num entries, pages 1082 FOR I=1 TO VAL(Pass$(0,1)) 1083 READ Pass$(I,1),Pass_name$(I),Pass$(I,2) 1084 NEXT I 1085 Pass$(1,2)=Serial_num$ 1086 ! 1087 ! -------------------- Pass Control to Non-existant Controller ------------------- 1088 ! 1089 PRINT FNWrite_mod_num(Trick_model_num$&Model_num$[8,50]) 1090 Full_address=VAL(Tam_cndtns$(1,2)) 1091 Select_code=INT(Full_address/100) 1092 PASS CONTROL Full_address 1093 LOCAL Select_code 1094 ! 1095 ! ------------------------------ Pass Control Loop ------------------------------- 1096 ! 1097 REPEAT ! 1098 Quit=0 1099 Next_menu=0 1100 Pass_cntl=0 1101 IF Sequence_type=1 THEN Menu$="Test Menu" 1102 IF Sequence_type=2 THEN Menu$="Adjustments Menu" 1103 IF Sequence_type=3 THEN Menu$="Diagnostics Menu" 1104 Draw_alpha_hdr(Menu$) 1105 Case$="Pass_cntl" 1106 STATUS KBD,9;Kbd_status 1107 IF BIT(Kbd_status,5) THEN ! HP46020A keyboard 1108 Key_title$="PASS CONTROL,,,,,,,,,RESUME CONTROL," 1109 ELSE 1110 Key_title$="PASS CONTROL,,,,,,,,,RESUME CONTROL," 1111 END IF 1112 Page=1+(Test_number>10) 1113 Label_keys(Key_title$,Key_pressed$,Pass$(*),Test_number,Page) ! Write page and label soft keys 1114 GOSUB Inter_pass_keys ! Decode key press selection 1115 ! 1116 IF Pass_cntl=0 THEN GOTO 1134 1117 ! 1118 Compatible_flag=1 ! Enable list of compatible tests 1119 IF Sequence_type=1 THEN Menu$="Test Menu" 1120 IF Sequence_type=2 THEN Menu$="Adjustments Menu" 1121 IF Sequence_type=3 THEN Menu$="Diagnostics Menu" 1122 Draw_alpha_hdr(Menu$) 1123 Case$="Resume_cntl" 1124 STATUS KBD,9;Kbd_status 1125 IF BIT(Kbd_status,5) THEN ! HP46020A keyboard 1126 Key_title$=",,,,,,,,,RESUME CONTROL," 1127 ELSE 1128 Key_title$=",,,,,,,,,RESUME CONTROL," 1129 END IF 1130 Page=1+(Test_number>10) 1131 CALL Compatibility(Sequence_type) 1132 Label_keys(Key_title$,Key_pressed$,Pass$(*),Test_number,Page) ! Write page and label soft keys 1133 GOSUB Inter_pass_keys ! Decode key press selection 1134 UNTIL Quit ! Abort key exits this loop by 1135 SUBEXIT ! setting Quit to 1 1136 ! 1137 ! 1138 Inter_pass_keys: ! Decodes selection and mode and calls proper routines 1139 ! -------------------------- Interpret PASS CONTROL SFKs ------------------------- 1140 ! 1141 SELECT Key_pressed$ ! The name of the key pressed 1142 CASE "PASS CONTROL" 1143 Pass_cntl=1 1144 CASE "RESUME CONTROL" 1145 CALL Abort_7 1146 DISP " ABORT ";Select_code;" sent to restore computer as system controller, standby!" 1147 WAIT 2 1148 IF Model_num$[1,7]="HP8562E" THEN DISP " Restoring SPECTRUM ANALYZER Model to HP8562E" 1149 WAIT 1 1150 CALL Restore_mod_num 1151 Quit=1 1152 Compatible_flag=0 1153 END SELECT 1154 RETURN 1155 ! 1156 ! 1157 Pass_data: DATA 1,1 ! Test title, Short name, Conn check 1158 ! --------------------------- PASS CONTROL Screen Data --------------------------- 1159 DATA "SPECTRUM ANALYZER Serial Number:","","" 1160 !DATA "SPECTRUM ANALYZER is now a Model","","" 1161 ! 1162 SUBEND 1163 ! 1164 ! 1165 Restore_mod_num: SUB Restore_mod_num 1166 ! ------------------------- RESTORE MODEL NUMBER SUBROUTINE ------------------------ 1167 ! 1168 COM /Tam_cndtns/Tam_cndtns$(*) 1169 ! 1170 Full_address=VAL(Tam_cndtns$(1,2)) 1171 Select_code=INT(Full_address/100) 1172 ON ERROR GOTO Nothing_there 1173 LOCAL Select_code 1174 REMOTE Select_code 1175 OFF ERROR 1176 Address=Full_address MOD 100 1177 ON TIMEOUT Select_code,1 GOTO Nothing_there 1178 ASSIGN @Dut TO Full_address 1179 OUTPUT @Dut;"IP" 1180 WAIT 2 1181 OFF TIMEOUT 1182 Ser_num_fname$=Tam_cndtns$(6,2) 1183 ASSIGN @Store_model TO Ser_num_fname$ 1184 ENTER @Store_model;Model_num$ 1185 ASSIGN @Store_model TO * 1186 ! 1187 ! *** write the model back to the spectrum analyzer 1188 Result=FNWrite_mod_num(Model_num$) 1189 ASSIGN @Store_model TO * 1190 ! 1191 Nothing_there: OFF ERROR ! dummy statement 1192 IF Model_num$[1,7]<>"HP8562E" THEN 1193 CALL Instructions("Wrong_id") 1194 FOR I=1 TO 5 1195 BEEP 200,.1 1196 BEEP 300,.1 1197 NEXT I 1198 INPUT X$ 1199 ELSE 1200 END IF 1201 SUBEND 1202 ! 1203 ! 1204 DEF FNWrite_mod_num(Model_num$) 1205 ! ------------------------ Write ID String to Spectrum Analyzer -------------------- 1206 ! 1207 COM /Tam_cndtns/Tam_cndtns$(0:26,1:2)[160] 1208 ! 1209 Full_address=VAL(Tam_cndtns$(1,2)) 1210 Select_code=INT(Full_address/100) 1211 ON ERROR GOTO Nothing_there 1212 LOCAL Select_code 1213 REMOTE Select_code 1214 OFF ERROR 1215 Address=Full_address MOD 100 1216 ON TIMEOUT Select_code,1 GOTO Nothing_there 1217 ASSIGN @Dut TO Full_address 1218 OUTPUT @Dut;"ZENTID'";Model_num$&"'" 1219 OUTPUT @Dut;"IP" 1220 WAIT 2 1221 OUTPUT @Dut;"ID?" 1222 ENTER @Dut;Restored_num$ 1223 IF Restored_num$<>Model_num$ THEN 1224 CALL Instructions("Wrong_id") 1225 FOR I=1 TO 5 1226 BEEP 200,.1 1227 BEEP 300,.1 1228 NEXT I 1229 INPUT X$ 1230 ELSE 1231 END IF 1232 Nothing_there: ASSIGN @Dut TO * 1233 RETURN 1 1234 FNEND 1235 ! 1236 ! 1237 Prompt_user: SUB Prompt_user(Message$) 1238 ! ---------------------------------- PROMPT USER ----------------------------------- 1239 DIM Append$[25],Key$[160] 1240 ! 1241 IF NPAR=2 THEN 1242 IF Flag=3 THEN SUBEXIT 1243 END IF 1244 ! 1245 IF POS(Message$,"error;") THEN 1246 BEEP 100,.1 1247 ELSE 1248 END IF 1249 ! 1250 Append$=" (any key)" 1251 IF NPAR=2 THEN 1252 IF Flag=2 THEN Append$="(any key OR 'Q' to quit)" 1253 END IF 1254 ! 1255 DISP Message$&Append$ 1256 CONTROL 1,12;1 ! SFKs OFF 1257 ON KBD ALL,15 GOTO Kbd_cont 1258 GOTO 1257 1259 Kbd_cont: Key$=KBD$ 1260 OFF KBD 1261 CONTROL 1,12;2 ! SFKs ON 1262 DISP 1263 ! 1264 IF NPAR=2 THEN 1265 IF Flag=2 THEN ! Quit flag 1266 IF UPC$(Key$[1,1])="Q" THEN Flag=3 ! Q key pressed? 1267 ELSE 1268 Flag=1 1269 END IF 1270 END IF 1271 ! 1272 SUBEND 1273 ! 1274 ! 1275 Abort_7: SUB Abort_7 1276 ! ----------------------------- Abort 7, Restore Control --------------------------- 1277 ! 1278 COM /Tam_cndtns/Tam_cndtns$(*) 1279 Full_address=VAL(Tam_cndtns$(1,2)) 1280 Select_code=INT(Full_address/100) 1281 ABORT Select_code 1282 LOCAL Select_code 1283 ! 1284 SUBEND ! Abort_7 1285 ! 1286 ! 1287 Instructions: SUB Instructions(Instruction$) 1288 ! -------------------------------- USER INSTRUCTIONS ------------------------------- 1289 ! 1290 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 1291 COM /Menu/Menu$[50],Msg1$[80],Msg2$[80],Msg3$[80],Msg4$[80],Msg5$[80],Msg6$[80],Msg7$[80],Msg8$[80],Case$[11] 1292 STATUS CRT,13;Height 1293 BEEP 200,.1 1294 BEEP 400,.1 1295 SELECT Instruction$ 1296 CASE "Main" 1297 Line=12 1298 Msg1$="USER INSTRUCTIONS" 1299 Msg2$="Before continuing, check that the WR PROT/WR ENA jumper on the A2 Controller" 1300 Msg3$="Assembly is in the WR ENA position. " 1301 Msg4$=RPT$(" ",76) 1302 Msg5$=RPT$(" ",76) 1303 CASE "No_dut" 1304 Line=12 1305 Msg1$="USER INSTRUCTIONS" 1306 Msg2$="Unable to communicate with the SPECTRUM ANALYZER. Ensure that power is on, " 1307 Msg3$="that the HPIB cable is properly connected, and verify the HPIB address. " 1308 Msg4$="Press the QUERY DUT key to retry or press the EXIT key, correct the problem," 1309 Msg5$="and then re-start the program. " 1310 CASE "Test" 1311 Line=15 1312 Msg1$="Move the pointer to a test, then press the SELECT key to start the test or " 1313 Msg2$="press the MAIN MENU key to return to the main menu. " 1314 Msg3$=" " 1315 Msg4$=" " 1316 Msg5$=" " 1317 CASE "Adjust" 1318 Line=15 1319 Msg1$="Move the pointer to an adjustment, then press the SELECT key to start the " 1320 Msg2$="adjustment or press the MAIN MENU key to return to the main menu. " 1321 Msg3$=" " 1322 Msg4$=" " 1323 Msg5$=" " 1324 CASE "Diagnostic" 1325 Line=14 1326 Msg1$="Move the pointer to a diagnostic, then press the SELECT key to start the " 1327 Msg2$="diagnostic or press the MAIN MENU key to return to the main menu. " 1328 Msg3$=" " 1329 Msg4$=" " 1330 Msg5$=" " 1331 CASE "Write_id" 1332 Line=9 1333 Msg1$="Press the WRITE NEW ID$ key to send the SPECTRUM ANALYZER the new model " 1334 Msg2$="number string or press the SELECT MENU key to return to the selections " 1335 Msg3$="menu. " 1336 Msg4$=" " 1337 Msg5$=" " 1338 CASE "Pass_cntl" 1339 Line=7 1340 Msg1$="Cycle SPECTRUM ANALYZER power. After REALIGN (see analyzer screen) " 1341 Msg2$="completes, press the PASS CONTROL key. " 1342 Msg3$=" " 1343 Msg4$=" " 1344 Msg5$=" " 1345 CASE "Resume_cntl" 1346 Line=15 1347 Msg1$="Other available TAM functions (with limitations) are shown above. Press " 1348 Msg2$="the RESUME CONTROL key to select TAM functions not shown above. " 1349 Msg3$=" " 1350 Msg4$=" " 1351 Msg5$=" " 1352 CASE "Wrong_id" 1353 Line=7 1354 FOR I=6 TO 17 1355 PRINT TABXY(4,I);RPT$(" ",76) 1356 NEXT I 1357 Msg1$="Unable to restore ID string. You must return to the MAIN MENU to correct. " 1358 Msg2$="Press the Return key to acknowledge. " 1359 Msg3$=" " 1360 Msg4$=" " 1361 Msg5$=" " 1362 END SELECT 1363 PRINT TABXY(4,Line),Msg1$ 1364 PRINT TABXY(4,Line+1),Msg2$ 1365 IF Instruction$<>"Resume_cntl" OR Height>24 THEN 1366 PRINT TABXY(4,Line+2),Msg3$ 1367 PRINT TABXY(4,Line+3),Msg4$ 1368 PRINT TABXY(4,Line+4),Msg5$ 1369 ELSE 1370 END IF 1371 SUBEND ! Instructions 1372 ! 1373 ! 1374 Compatibility: SUB Compatibility(Sequence_type) ! 1375 ! ---------------------- COMPATIBLE TESTS for a GIVEN MODEL NUMBER ----------------- 1376 COM /Tests/Tests$(*),Short_name$(*) 1377 COM /Adj_block/Adj$(*),Adj_name$(*) 1378 COM /Diag_block/Diag$(*),Diag_name$(*) 1379 COM /Pass_block/Pass$(*),Pass_name$(*) 1380 COM /Tam_cond/Model_num$[50],Serial_num$[10],Test_name$[45],Trick_model_num$[7] 1381 Counter=0 1382 SELECT Sequence_type 1383 CASE 1 1384 FOR Loop=1 TO VAL(Tests$(0,1)) 1385 IF Short_name$(Loop)=Trick_model_num$ THEN 1386 Counter=Counter+1 1387 Pass$(Counter,1)=Tests$(Loop,1) 1388 Pass$(Counter,2)=Tests$(Loop,2) 1389 ELSE 1390 END IF 1391 NEXT Loop 1392 Pass$(0,1)=VAL$(Counter) 1393 Pass$(0,2)=VAL$(1) 1394 IF Counter>9 THEN Pass$(0,2)=VAL$(2) 1395 ! 1396 CASE 2 1397 FOR Loop=1 TO VAL(Adj$(0,1)) 1398 IF Adj_name$(Loop)=Trick_model_num$ THEN 1399 Counter=Counter+1 1400 Pass$(Counter,1)=Adj$(Loop,1) 1401 Pass$(Counter,2)=Adj$(Loop,2) 1402 ELSE 1403 END IF 1404 NEXT Loop 1405 Pass$(0,1)=VAL$(Counter) 1406 Pass$(0,2)=VAL$(1) 1407 IF Counter>9 THEN Pass$(0,2)=VAL$(2) 1408 ! 1409 CASE 3 1410 FOR Loop=1 TO VAL(Diag$(0,1)) 1411 IF Diag_name$(Loop)=Trick_model_num$ THEN 1412 Counter=Counter+1 1413 Pass$(Counter,1)=Diag$(Loop,1) 1414 Pass$(Counter,2)=Diag$(Loop,2) 1415 ELSE 1416 END IF 1417 NEXT Loop 1418 Pass$(0,1)=VAL$(Counter) 1419 Pass$(0,2)=VAL$(1) 1420 IF Counter>9 THEN Pass$(0,2)=VAL$(2) 1421 END SELECT 1422 Compatible_flag=0 1423 ! 1424 SUBEND ! Compatibility 1425 ! 1426 ! 1427 Input: SUB Input(In$) 1428 OUTPUT KBD;"#";In$;"H"; 1429 ENTER KBD;In$ 1430 OUTPUT KBD;"#";" ";"H"; 1431 DISP RPT$(" ",80) 1432 DISP RPT$(" ",80) 1433 SUBEND 1434 !