DECLARE SUB hp3457preset () DECLARE SUB hp3457readv (v!) DECLARE SUB hp3457setupv (c%) DECLARE SUB hp3457cv (c%, v!) DECLARE SUB imagmeas (imag!) DECLARE SUB hpmxccv (mxcard%, mxchan%, v!) DECLARE SUB k7011closecc (card%, chan%) DECLARE SUB k7011openall () DECLARE SUB hp3457setuptc (c%) DECLARE SUB hp3457readtc (tc!) DECLARE SUB gettestparam () DECLARE SUB measure () DECLARE SUB logmrt (logfile$, m%, nrt%, tim$(), imag!(), vmag!(), rmag!(), twin!(), twout!(), tiron!(), tcoil!(), tamb!()) DECLARE SUB rmeas (m%, imag!, vmag!, rmag!) DECLARE SUB tmeas (m%, twin!, twout!, tiron!, tcoil!, tamb!) DECLARE SUB imagramp (rr!, ifin!) DECLARE SUB fileheader (logfile$, mn$, op$, ts$, dv$, rn$, cm$) DECLARE SUB fileinitl (test$, run$, logfile$, ok$) DECLARE SUB filemkdir (DestDir$) DECLARE SUB gpibinit () DECLARE SUB k7011init () DECLARE SUB hp3457init () DECLARE SUB dac488hrinit () DECLARE SUB dac488hrsetupv () '**************************************************************************** 'Program HERDRT 'This program is used to measure the resistance and temperature of the 'B-Factory HER dipoles. It samples the magnet voltage and current to 'get the magnet resistance. It measures the resistance of several 'thermistors to get magnet temperatures. ' 'Zachary Wolf '6/5/94 '**************************************************************************** 'Include the constants used in the program REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Initialize the GPIB CALL gpibinit 'Initialize the DAC CALL dac488hrinit CALL dac488hrsetupv 'Initialize the HP3457 CALL hp3457init 'Initialize the K7011 multiplexer CALL k7011init 'Print a message about the program PRINT PRINT "Program HERDRT" PRINT "This program measures the resistances and temperatures of all three" PRINT "B-Factory HER dipoles on the test stands." PRINT PRINT "The magnet resistances and temperatures will be measured at regular" PRINT "intervals for as long as you specify. The measurements will be" PRINT "made at the current you specify." PRINT PRINT 'Get test parameters from the operator testparam: CALL gettestparam 'Create the \magdata subdirectory to store the log files subdir1$ = "c:\magdata\" + magname1P$ CALL filemkdir(subdir1$) subdir2$ = "c:\magdata\" + magname2P$ CALL filemkdir(subdir2$) 'Initialize the log file CALL fileinitl(subdir1$ + "\" + "rt", runP$, logfile1P$, ok1$) CALL fileinitl(subdir2$ + "\" + "rt", runP$, logfile2P$, ok2$) IF ok1$ <> "y" OR ok2$ <> "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 fileheader(logfile1P$, magname1P$, operatorP$, "D1", "HP thermistors", runP$, commentP$) CALL fileheader(logfile2P$, magname2P$, operatorP$, "D2", "HP thermistors", runP$, commentP$) 'Perform the measurements CALL measure 'Message PRINT PRINT "Ramping to 0 Amps." 'Ramp to 0 amps CALL imagramp(imagramprateP!, 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: ' magname1P$, name of magnet 1 ' magname2P$, name of magnet 2 ' operatorP$, name of the operator doing the test ' runP$, run number ' commentP$, comment about the test ' 'Zachary Wolf '4/16/94 '**************************************************************************** begin: 'Get the name of the magnet on test stand 1 PRINT "What is the name of the magnet on test stand D1?" PRINT "(8 characters or less): ["; magname1P$; "]"; INPUT magname1$ magname1$ = UCASE$(magname1$) IF magname1$ <> "" THEN magname1P$ = magname1$ 'Get the name of the magnet on test stand 2 PRINT "What is the name of the magnet on test stand D2?" PRINT "(8 characters or less): ["; magname2P$; "]"; INPUT magname2$ magname2$ = UCASE$(magname2$) IF magname2$ <> "" THEN magname2P$ = magname2$ 'Get the operator's name(s) PRINT "Enter the operator(s) name(s): ["; operatorP$; "]"; LINE 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 SUB measure '**************************************************************************** 'This subroutine controls the resistance and temperature measurements. ' 'Zachary Wolf '7/8/94 '**************************************************************************** 'Get the desired current getinom: PRINT INPUT "What current do you wish to ramp to? (0 1000 THEN PRINT : PRINT "The current must be between 0