DECLARE SUB dac488init () DECLARE SUB dac488setupv () DECLARE SUB initfile (ok$) DECLARE SUB gpibinit () DECLARE SUB hp3457init () DECLARE SUB ds335init () DECLARE SUB k7011init () DECLARE SUB rtmain () DECLARE SUB imagramp (inom!) DECLARE SUB fileheader (logfile$) DECLARE SUB filemkdir (destdir$) DECLARE SUB fileopenout (destdir$, basename$, ext$, filename$, ok$) DECLARE SUB fileprnt (file$) DECLARE SUB fileprot (file$) DECLARE SUB gettestparam () '**************************************************************************** 'Program RTCYCLE 'This program thermal cycles an object by alternately passing current 'through it to heat it, then letting water cool it down. ' 'Zachary Wolf '5/9/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' 'The parameters required for this module are 'Make file names common to all procedures 'COMMON SHARED /filenames/ logfileP$, rawfileP$, rtdatP$, sldatP$, slpltP$, hardatP$, harpltP$ 'Put the test parameters in a common block 'COMMON SHARED /testparam/ magnameP$, barcodeP$, projectP$, teststandP$, coilnameP$, operatorP$, runP$, commentP$ 'Fill the test parameters 'projectP$ = "PEP II High Energy Ring Sextupoles" 'teststandP$ = "IR8, S1" 'coilnameP$ = "# 1" 'Put the desired standardization and measurement currents in a common block 'COMMON SHARED /currents/ imagstandP!(), imagtestP!(), imagtestharP!() 'Define the standardization cycle 'CONST nimagstandP% = 8 'the number of standardization currents 'DIM imagstandP!(1 TO nimagstandP%) 'the current array 'imagstandP!(1) = 250! 'standardization currents 'Define the test currents 'CONST nimagtestP% = 4 'number of measurement currents 'DIM imagtestP!(1 TO nimagtestP%) 'the current array 'imagtestP!(1) = 25! 'SL vs I currents 'Define the harmonics currents 'DIM imagtestharP!(1 TO nimagtestP%) 'the current array 'imagtestharP!(1) = 0! '1=record harmonics, 0=don't 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the HP3457 CALL hp3457init 'Initialize the DAC CALL dac488init CALL dac488setupv 'STOP 'Initialize the multiplexer CALL k7011init 'Print a message about the program PRINT PRINT "Program RTCYCLE" PRINT "This program thermal cycles an object." 'Get test parameters from the operator testparam: CALL gettestparam 'Initialize the files for this run CALL initfile(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 rtmain 'Ramp to 0 amps 'CALL imagramp(0!) 'Message PRINT "The test is complete." END SUB initfile (ok$) '**************************************************************************** 'This subroutine does all the file initialization for the RT cycle 'measurements. ' 'Output: ' ok$, ="y" if the file handling went ok, "n" otherwise ' 'Zachary Wolf '11/15/94 '**************************************************************************** 'Initialize ok$ = "n" 'Create the \magdata subdirectory to store the files subdir$ = "c:\magdata\" + magnameP$ CALL filemkdir(subdir$) 'Form the extension for all the files r% = VAL(runP$) IF r% < 10 THEN ext$ = "ru" + runP$ IF r% >= 10 THEN ext$ = "r" + runP$ 'RT 'Initialize the dat file for the rt measurements 'Exit with ok$="n" if there is a problem CALL fileopenout(subdir$, "rtdat", ext$, rtdatP$, okopen$) IF okopen$ <> "y" THEN GOTO pblmexit 'Write headers to the dat file CALL fileheader(rtdatP$) 'Make a .bat file to write protect the data CALL fileprot(rtdatP$) 'Make a .bat file to print the dat file CALL fileprnt(rtdatP$) 'Initialize the plt file for the rt measurements 'Exit with ok$="n" if there is a problem CALL fileopenout(subdir$, "rtplt", ext$, rtpltP$, okopen$) IF okopen$ <> "y" THEN GOTO pblmexit 'LOGFILE 'Initialize the log file for the run 'Exit with ok$="n" if there is a problem CALL fileopenout(subdir$, "logfile", ext$, logfileP$, okopen$) IF okopen$ <> "y" THEN GOTO pblmexit 'Write headers to the log file CALL fileheader(logfileP$) 'Make a .bat file to write protect the data CALL fileprot(logfileP$) 'If we made it this far, things are ok ok$ = "y" pblmexit: END SUB