DECLARE SUB lgpsoff () DECLARE SUB lgpson () DECLARE SUB vaxstandardize () DECLARE SUB gettestparam () DECLARE SUB blmeasure () DECLARE SUB imagramp (inom!) DECLARE SUB fileheaderii (logfile$, mn$, pr$, 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 INJBEND 'This program is used to measure the integrated field strength of the 'Injection 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. ' 'Zachary Wolf '11/25/94 '**************************************************************************** 'Include the constants used in the program REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the HP3457 CALL hp3457init 'Initialize the power supply control CALL lgpson 'Print a message about the program PRINT PRINT "Program INJBEND" PRINT "This program measures the integrated field strengths of the" PRINT "B-Factory Injection Line dipoles as a function of current." PRINT "Make sure the coil is centered in the magnet." 'Get test parameters from the operator testparam: CALL gettestparam 'Initialize the log, data, and plot files CALL fileinitldp(magnameP$, runP$, "bl", 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!(), nimagblP%, imagblP!()) CALL fileheaderii(datfileP$, magnameP$, projectP$, operatorP$, teststandP$, coilP$, runP$, commentP$, nimagstandP%, imagstandP!(), nimagblP%, imagblP!()) 'Standardize the magnet CALL vaxstandardize 'Do the measurements CALL blmeasure 'Ramp to 0 amps, turn off the power supply 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 ' runP$, run number ' commentP$, comment about the test ' 'Zachary Wolf '11/25/94 '**************************************************************************** begin: 'Get the name of the magnet PRINT 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