DECLARE SUB lgpsoff () DECLARE SUB rt () DECLARE SUB imagstandardize () DECLARE SUB lgpson () DECLARE SUB startup () DECLARE SUB gettestparam () DECLARE SUB quad () DECLARE SUB imagramp (inom!) DECLARE SUB fileinit (ok$) DECLARE SUB gpibinit () DECLARE SUB hp3457init () '**************************************************************************** 'Program INJQUAD 'This program is used to make the rotating coil measurements of the 'B-Factory injection 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 VAX link CALL lgpson 'Print a message about the program PRINT PRINT "Program INJQUAD" PRINT "This program performs the rotating coil measurements on the" PRINT "B-Factory injection line quadrupoles." PRINT '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 'Have the VAX turn the power supply off CALL lgpsoff '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 ' coilP$, 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 "What is the name of the quadrupole being tested?" PRINT "(8 characters or less): ["; magnameP$; "]"; INPUT magname$ magname$ = UCASE$(magname$) IF magname$ <> "" THEN magnameP$ = magname$ '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): ["; coilP$; "]"; 'INPUT coil$ 'coil$ = UCASE$(coil$) 'IF coil$ <> "" THEN coilP$ = coil$ 'IF coilP$ <> "QC1" AND coilP$ <> "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