'**************************************************************************** 'Module LOGBL 'This module contains subroutines to create and fill the log, data, and 'plot files. ' 'Zachary Wolf '6/3/94 '**************************************************************************** SUB logbl (logfile$, m%, ni%, imag!(), vt!(), svt!(), vtxc!(), svtxc!(), r!(), sr!(), bl!(), sbl!(), tf!(), stf!()) '**************************************************************************** 'This subroutine writes the bl measurement log file. ' 'Inputs: ' logfile$, the name of the log file ' m%, index giving the magnet under test 1 or 2 ' ni%, the number of currents ' imag!(1 to ni%, 0 to 2), the measured currents ' vt!(1 to ni%, 0 to 2), the integrated voltages ' svt!(1 to ni%, 0 to 2), the standard deviation on the measured integrated voltage ' vtxc!(1 to ni%, 0 to 2), vt with the coil cross calibration applied ' svtxc!(1 to ni%, 0 to 2), standard deviation on vtxc! ' r!(1 to ni%, 0 to 2), ratio of test magnet strength to reference strength ' sr!(1 to ni%, 0 to 2), error estimate of r! ' bl!(1 to ni%, 0 to 2), the integrated field strengths ' sbl!(1 to ni%, 0 to 2), the standard deviation on the integrated field strength ' tf!(1 to ni%, 0 to 2), the magnet transfer function BL/I ' stf!(1 to ni%, 0 to 2), the standard deviation on the transfer function ' 'Zachary Wolf '5/4/94, 6/2/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'For the reference magnet PRINT #filenum%, PRINT #filenum%, "BL Measurements For The Reference Magnet:" 'Write the header PRINT #filenum%, " I VT sigVT BL sigBL BL/I sigBL/I " PRINT #filenum%, " (A) (VS) (VS) (TM) (TM) (TM/KA) (TM/KA) " PRINT #filenum%, "------- -------- -------- -------- -------- -------- --------" 'Write the values FOR i% = 1 TO ni% PRINT #filenum%, USING "####.##"; imag!(i%, 0); PRINT #filenum%, USING " ##.#####"; vt(i%, 0); PRINT #filenum%, USING " ##.#####"; svt!(i%, 0); PRINT #filenum%, USING " ##.#####"; bl!(i%, 0); PRINT #filenum%, USING " ##.#####"; sbl!(i%, 0); PRINT #filenum%, USING " ##.#####"; tf!(i%, 0) * 1000!; PRINT #filenum%, USING " ##.#####"; stf!(i%, 0) * 1000! NEXT i% 'For the magnet under test PRINT #filenum%, PRINT #filenum%, "BL Measurements For The Magnet Under Test:" 'Write the header PRINT #filenum%, " I VTXC sigVTXC ratio sig BL sigBL BL/I sigBL/I " PRINT #filenum%, " (A) (VS) (VS) VTXC/VTR VTXC/VTR (TM) (TM) (TM/KA) (TM/KA) " PRINT #filenum%, "------- -------- -------- -------- -------- -------- -------- -------- --------" 'Write the values FOR i% = 1 TO ni% PRINT #filenum%, USING "####.##"; imag!(i%, m%); PRINT #filenum%, USING " ##.#####"; vtxc!(i%, m%); PRINT #filenum%, USING " ##.#####"; svtxc!(i%, m%); PRINT #filenum%, USING " #.#####"; r!(i%, m%); PRINT #filenum%, USING " #.#####"; sr!(i%, m%); PRINT #filenum%, USING " ##.#####"; bl!(i%, m%); PRINT #filenum%, USING " ##.#####"; sbl!(i%, m%); PRINT #filenum%, USING " ##.#####"; tf!(i%, m%) * 1000!; PRINT #filenum%, USING " ##.#####"; stf!(i%, m%) * 1000! NEXT i% 'Message PRINT #filenum%, PRINT #filenum%, "NOTE!!!" PRINT #filenum%, "Coil 0 does not have its absolute calibration yet." PRINT #filenum%, "BL = VTX above." 'Close the log file CLOSE filenum% END SUB SUB logplot (logfile$, magname$, run$, m%, ni%, imag!(), vt!(), svt!(), vtxc!(), svtxc!(), r!(), sr!(), bl!(), sbl!(), tf!(), stf!()) '**************************************************************************** 'This subroutine writes the BL measurement plot file for plotting. ' 'Inputs: ' logfile$, the name of the log file ' magname$, magnet name ' run$, run number ' m%, the magnet number ' ni%, the number of currents ' imag!(1 to ni%, 0 to 2), the current the test magnet was measured at ' vt!(1 to ni%, 0 to 2), the integrated voltage measurements ' svt!(1 to ni%, 0 to 2), standard deviation on vt! ' vtxc!(1 to ni%, 0 to 2), integrated voltage with coil cross calibration applied ' svtxc!(1 to ni%, 0 to 2), standard deviation on vtxc! ' r!(1 to ni%, 0 to 2), ratio of vtx to vt_reference ' sr!(1 to ni%, 0 to 2), standard deviation on r! ' bl!(1 to ni%, 0 to 2), the integrated field strengths ' sbl!(1 to ni%, 0 to 2), the error on bl! ' tf!(1 to ni%, 0 to 2), the transfer function ' stf!(1 to ni%, 0 to 2), the error on tf! ' 'Zachary Wolf '5/12/94, 6/2/94 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Write the title for plotting PRINT #filenum%, "/et g '" + magname$ + ", Run " + run$ + "'" PRINT #filenum%, ";i r sr bl sbl tf stf tfref stfref" 'Write the values FOR i% = 1 TO ni% PRINT #filenum%, USING "####.##"; imag!(i%, m%); PRINT #filenum%, USING " #.#####"; r!(i%, m%); PRINT #filenum%, USING " #.#####"; sr!(i%, m%); PRINT #filenum%, USING " ##.#####"; bl!(i%, m%); PRINT #filenum%, USING " ##.#####"; sbl!(i%, m%); PRINT #filenum%, USING " ##.#####"; tf!(i%, m%) * 1000!; PRINT #filenum%, USING " ##.#####"; stf!(i%, m%) * 1000!; PRINT #filenum%, USING " ##.#####"; tf!(i%, 0) * 1000!; PRINT #filenum%, USING " ##.#####"; stf!(i%, 0) * 1000! NEXT i% 'Close the log file CLOSE filenum% END SUB