DECLARE SUB harmeasure () DECLARE SUB gettestparam () DECLARE SUB measure () DECLARE SUB standardize () DECLARE SUB loghar (logfile$, ni%, nx%, imag!(), vt!(), svt!(), bl!(), sbl!(), tf!(), stf!()) DECLARE SUB logplot (logfile$, magname$, run$, ni%, nx%, imag!(), vt!(), svt!(), bl!(), sbl!(), tf!(), stf!()) DECLARE SUB bl1pt (imag!, vt!, svt!, bl!, sbl!, tf!, stf!) DECLARE SUB imagramp (rr!, ifin!) DECLARE SUB fileheaderii (logfile$, mn$, op$, ts$, dv$, rn$, cm$, n1%, i1!(), n2%, i2!()) DECLARE SUB fileinitldp (magname$, run$, test$, logfile$, datfile$, pltfile$, ok$) DECLARE SUB gpibinit () DECLARE SUB dac488hrinit () DECLARE SUB dac488hrsetupv1 () DECLARE SUB hp3457init () '**************************************************************************** 'Program ALINEHAR 'This program is used to measure the integrated harmonics in the 'A-Line dipoles. It samples the voltage from the rotating coil. 'It then numerically integrates the coil voltage as a function of time 'over a half period. This gives the change of flux in the coil as it is 'flipped. The integrated dipole field strength is then determined. 'This is done at several x-locations to determine the harmonics. ' 'Zachary Wolf '11/25/94 '**************************************************************************** 'Include the constants and common blocks used in the program REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the DAC CALL dac488hrinit CALL dac488hrsetupv1 'Initialize the HP3457 CALL hp3457init 'Print a message about the program PRINT PRINT "Program ALINEHAR" PRINT "This program measures the integrated field strengths of" PRINT "A-Line dipoles on the test stand as a function of current" PRINT "and as a function of x-position across the gap. In this way" PRINT "the field quality in the magnet can be determined." PRINT 'Get test parameters from the operator testparam: CALL gettestparam 'Initialize the log, data, and plot files CALL fileinitldp(magnameP$, runP$, "har", logfileP$, datfileP$, pltfileP$, 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 'Write headers to the log and data files CALL fileheaderii(logfileP$, magnameP$, projectP$, operatorP$, teststandP$, coilP$, runP$, commentP$, nimagstandP%, imagstandP!(), imagnharP%, imagharP!()) CALL fileheaderii(datfileP$, magnameP$, projectP$, operatorP$, teststandP$, coilP$, runP$, commentP$, nimagstandP%, imagstandP!(), imagnharP%, imagharP!()) 'Standardize the magnet 'CALL imagstandardize 'Do the measurements CALL harmeasure '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 the magnet ' operatorP$, name of the operator doing the test ' runP$, run number ' commentP$, comment about the test ' 'Zachary Wolf '11/25/94 '**************************************************************************** begin: 'Get the name of the magnet PRINT "What is the name of the magnet?" 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 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