SUB logheader (logfile$, mn$, op$, ts$, dv$, rn$, cm$) '**************************************************************************** 'This subroutine writes the header of the log file. ' 'Input: ' logfile$, name, including the path, of the log file ' mn$, magnet name ' op$, operator name ' ts$, the name of the test stand which is being used ' dv$, the name of the measurement device ' rn$, the run number ' cm$, a comment about the test ' 'Zachary Wolf '4/16/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print a general header PRINT #filenum%, "B-Factory Magnetic Measurements" PRINT #filenum%, "Date: "; DATE$ PRINT #filenum%, "Time: "; TIME$ PRINT #filenum%, 'Print the magnet test parameters to the log file PRINT #filenum%, "Magnet Name: "; mn$ PRINT #filenum%, "Test Operator: "; op$ PRINT #filenum%, "Test Stand: "; ts$ PRINT #filenum%, "Apparatus: "; dv$ PRINT #filenum%, "Run Number: "; rn$ PRINT #filenum%, "Comment: "; cm$ 'Close the log file CLOSE filenum% END SUB SUB logopen (logfile$) '**************************************************************************** 'This subroutine creates the log file. The name of the file is passed 'to the subroutine. It then closes the log file. All other routines append 'information to the file. ' 'Inputs: logfile$, path and name of the log file ' 'Zachary Wolf '4/14/94 '**************************************************************************** 'Create the log file filenum% = FREEFILE OPEN logfile$ FOR OUTPUT AS filenum% 'Close the log file CLOSE filenum% END SUB SUB logsumm (logfile$, c%, i!, vt!, svt!) '**************************************************************************** 'This subroutine writes a summary to the log file. ' 'Inputs: ' logfile$, the name of the log file ' c%, the coil number ' i!, the current ' vt!, the integrated voltage ' svt!, the estimated error on vt! ' 'Zachary Wolf '5/15/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Write which magnet the data is for PRINT #filenum%, PRINT #filenum%, "Averages:" 'Write the header PRINT #filenum%, " Coil I VT sigVT " PRINT #filenum%, " (A) (VS) (VS) " PRINT #filenum%, " ---- -------- -------- -------- " 'Write the values PRINT #filenum%, USING " ####"; c%; PRINT #filenum%, USING " ####.###"; i!; PRINT #filenum%, USING " ##.#####"; vt!; PRINT #filenum%, USING " ##.#####"; svt! 'Close the log file CLOSE filenum% END SUB SUB logvt (logfile$, m%, i1!, i2!, nave%, vtp!(), vtn!()) '**************************************************************************** 'This subroutine records the integrated voltage from the rotating coil 'to the log file. ' 'Input: ' logfile$, the name of the log file ' m%, index giving reference magnet 0 or magnet under test 1 ' i1!, the current before the measurement ' i2!, the current after the measurement ' nave%, the number of measurements used in the average ' vtp!(1 to nave%), the positive voltage integrals ' vtn!(1 to nave%), the negative voltage integrals ' 'Zachary Wolf '5/12/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Write the integrated voltage information to the log file PRINT #filenum%, PRINT #filenum%, "Coil "; m% PRINT #filenum%, "Ibefore = "; i1!, "Iafter = "; i2! 'Write the integrated voltages FOR i% = 1 TO nave% STEP 4 PRINT #filenum%, "VT+- = "; FOR j% = 0 TO 3 IF i% + j% > nave% THEN EXIT FOR PRINT #filenum%, USING " ##.#####"; vtp!(i% + j%); PRINT #filenum%, USING " ##.#####"; vtn!(i% + j%); NEXT j% PRINT #filenum%, NEXT i% 'Close the log file CLOSE filenum% END SUB