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$, i0!, vt0!, svt0!, i1!, vt1!, svt1!, i2!, vt2!, svt2!) '**************************************************************************** 'This subroutine writes a summary to the log file. ' 'Inputs: ' logfile$, the name of the log file ' i0!, the current when using coil 0 ' vt0!, the integrated voltage from coil 0 ' svt0!, the estimated error on vt0! ' i1!, the current when using coil 1 ' vt1!, the integrated voltage from coil 1 ' svt1!, the estimated error on vt1! ' i2!, the current when using coil 2 ' vt2!, the integrated voltage from coil 2 ' svt2!, the estimated error on vt2! ' 'Zachary Wolf '5/14/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Write which magnet the data is for PRINT #filenum%, PRINT #filenum%, "Cross Calibration Summary:" 'Write the header PRINT #filenum%, " Coil I VT sigVT " PRINT #filenum%, " (A) (VS) (VS) " PRINT #filenum%, " ---- -------- -------- -------- " 'Write the values PRINT #filenum%, USING " ####"; 0; PRINT #filenum%, USING " ####.###"; i0!; PRINT #filenum%, USING " ##.#####"; vt0!; PRINT #filenum%, USING " ##.#####"; svt0! PRINT #filenum%, USING " ####"; 1; PRINT #filenum%, USING " ####.###"; i1!; PRINT #filenum%, USING " ##.#####"; vt1!; PRINT #filenum%, USING " ##.#####"; svt1! PRINT #filenum%, USING " ####"; 2; PRINT #filenum%, USING " ####.###"; i2!; PRINT #filenum%, USING " ##.#####"; vt2!; PRINT #filenum%, USING " ##.#####"; svt2! '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