DECLARE SUB rt () DECLARE SUB imagstandardize () DECLARE SUB dac488init () DECLARE SUB dac488setupv () DECLARE SUB k7011init () DECLARE SUB gettestparam () DECLARE SUB quad () DECLARE SUB imagramp (inom!) DECLARE SUB fileinit (ok$) DECLARE SUB gpibinit () DECLARE SUB hp3457init () '**************************************************************************** 'Program HERQUAD 'This program is used to make the rotating coil measurements of the 'B-Factory HER quadrupoles. It samples the voltage from the rotating 'coil and Fourier analyzes the samples to get the strengths of 'each component of the field. ' 'Zachary Wolf '7/8/94, 9/10/94, 12/1/94, 1/4/95 '**************************************************************************** 'Open the parameter file 'This is required to fill the current arrays 'Such statements can only be executed in the main module REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the HP3457 CALL hp3457init 'Initialize the DAC CALL dac488init CALL dac488setupv 'Initialize the multiplexer CALL k7011init 'Print a message about the program PRINT PRINT "Program HERQUAD" PRINT "This program performs the rotating coil measurements on the" PRINT "B-Factory HER quadrupoles." 'Get test parameters from the operator testparam: CALL gettestparam 'Initialize the files for this run CALL fileinit(ok$) IF ok$ <> "y" THEN PRINT PRINT "Problem initializing the data files." PRINT "Make sure you are using a new run number." GOTO testparam: END IF 'Perform the RT measurements CALL rt 'Standardize the magnet CALL imagstandardize 'Measure the quadrupole field and harmonics CALL quad 'Message done: PRINT PRINT "Ramping to 0 Amps." 'Ramp to 0 amps CALL imagramp(0!) 'Message PRINT "The test is complete." END SUB gettestparam '**************************************************************************** 'This subroutine prompts the operator for the magnet name and other 'parameters of the test. ' 'Outputs put in the /testparam/ common block: ' magnameP$, name of magnet ' operatorP$, name of the operator doing the test ' teststandP$, the teststand being used ' coilnameP$, the ID of the measurement coil ' runP$, run number ' commentP$, comment about the test ' 'Zachary Wolf '7/8/94 '**************************************************************************** begin: 'Get the name of the magnet PRINT PRINT "What is the name (serial #) of the quadrupole being tested?" PRINT "(8 characters or less): ["; magnameP$; "]"; INPUT magname$ magname$ = UCASE$(magname$) IF magname$ <> "" THEN magnameP$ = magname$ 'Get the bar code number PRINT "What is the bar code number of the quadrupole ["; barcodeP$; "]"; INPUT barcode$ barcode$ = UCASE$(barcode$) IF barcode$ <> "" THEN barcodeP$ = barcode$ 'Get the operator's name(s) PRINT "Enter the operator(s) name(s): ["; operatorP$; "]"; INPUT operator$ IF operator$ <> "" THEN operatorP$ = operator$ 'Get the name of the test stand 'stand: 'PRINT "Enter which test stand is being used (Q1, Q2): ["; teststandP$; "]"; 'INPUT teststand$ 'teststand$ = UCASE$(teststand$) 'IF teststand$ <> "" THEN teststandP$ = teststand$ 'IF teststandP$ <> "Q1" AND teststandP$ <> "Q2" THEN GOTO stand 'Get the name of the measurement coil 'meascoil: 'PRINT "Enter the name of the measurement coil (QC1, or QC2): ["; coilnameP$; "]"; 'INPUT coil$ 'coil$ = UCASE$(coil$) 'IF coil$ <> "" THEN coilnameP$ = coil$ 'IF coilnameP$ <> "QC1" AND coilnameP$ <> "QC2" THEN GOTO meascoil 'Get the run number PRINT "What is the run number (1, 2, 3, ...): ["; runP$; "]"; INPUT run$ IF run$ <> "" THEN runP$ = run$ 'Get a comment PRINT "Enter any comment about the run: ["; commentP$; "]"; LINE INPUT comment$ IF comment$ <> "" THEN commentP$ = comment$ 'See if everything was entered correctly PRINT INPUT "Do you wish to make any changes to the values entered (Y or N): ", yn$ IF yn$ = "Y" OR yn$ = "y" THEN GOTO begin END SUB