DECLARE SUB imagstandardize () DECLARE SUB gettestparam () DECLARE SUB qw () DECLARE SUB imagramp (inom!) DECLARE SUB filewire (ok$) DECLARE SUB gpibinit () DECLARE SUB dac488init () DECLARE SUB dac488setupv () DECLARE SUB hp3457init () DECLARE SUB mc4init () DECLARE SUB mc4setup () DECLARE SUB mc4zero () DECLARE SUB hp3458init () '**************************************************************************** 'Program WIRE 'This program is used to make stretched wire measurements. ' 'Zachary Wolf '8/24/94, 1/14/95 '**************************************************************************** 'Include the constants used in the program 'Execute assignment statements REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the DAC CALL dac488init CALL dac488setupv 'Initialize the HP3457 CALL hp3457init 'Initialize the MC4 CALL mc4init 'Initialize the HP3458 CALL hp3458init 'Print a message about the program PRINT PRINT "Program WIRE" PRINT "This program performs wire scan measurements. It measures the" PRINT "integrated gradient of a quadrupole magnet." PRINT "It does this by finding the magnetic flux in the area enclosed" PRINT "by the wire's initial and final positions. The flux variations" PRINT "across the aperature of the magnet give the integrated gradient." 'Get test parameters from the operator testparam: CALL gettestparam 'Open the data files CALL filewire(ok$) IF ok$ <> "y" THEN PRINT : PRINT "Problem opening the data files. Try a different run number.": PRINT GOTO testparam: END IF 'Starting Position PRINT PRINT "Starting Position" PRINT "Please move the wire as close to the center of the magnet as possible." PRINT "The exact location is not critical." PRINT "This position will be the (0,0) position." INPUT "Press ENTER when ready. ", a$ CALL mc4zero CALL mc4setup 'Get the test current from the operator PRINT current: INPUT "What current do you wish to perform the measurement at? (Amps) ", inom! IF inom! < 0 OR inom! > 500! THEN PRINT "The current must be in the range 0 < I < 500 A" GOTO current: END IF 'Standardize the magnet CALL imagstandardize 'Message PRINT PRINT "Ramping to "; inom!; " Amps..." 'Ramp to the desired current CALL imagramp(inom!) 'Perform the stretched wire measurement CALL qw 'Message PRINT PRINT "Ramping to 0 Amps." 'Ramp to 0 amps CALL imagramp(0!) 'Message PRINT "The measurement 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 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