DECLARE SUB rtmeas (tm!) DECLARE SUB rtdat (logfile$, tim$, imag!, vmag!, rmag!, t1!, t2!, t3!, t4!, t5!) DECLARE SUB rtlog (logfile$, tim$, imag!, vmag!, rmag!, t1!, t2!, t3!, t4!, t5!) DECLARE SUB imaggeti (imag!) DECLARE SUB imagramp (inom!) DECLARE SUB vmaggetv (vmag!) DECLARE SUB tmaggettn (n%, tn!) '**************************************************************************** 'Module RT.BAS 'This module performs the resistance and temperature measurements. '**************************************************************************** 'Open the parameter file REM $INCLUDE: 'param.inc' 'The required parameters are 'tmagt1nameP$ 'tmagt2nameP$ 'tmagt3nameP$ 'tmagt4nameP$ 'tmagt5nameP$ 'rtdatP$ 'rttbtwnmeassecP% ' 'The required parameters are in 'TMAG 'FILE 'RT ' 'Sample RT parameters 'RT 'CONST rttbtwnmeassecP% = 60 '# seconds between RT measurements SUB rtdat (logfile$, tim$, imag!, vmag!, rmag!, t1!, t2!, t3!, t4!, t5!) '**************************************************************************** 'This subroutine writes the resistance and temperature measurements 'to the log file. ' 'Inputs: ' logfile$, the name of the log file ' tim$, the time the measurement was taken ' imag!, the magnet current ' vmag!, the magnet voltage ' rmag!, the magnet resistance ' t1!, temperature T1 in deg C ' t2!, temperature T2 in deg C ' t3!, temperature T3 in deg C ' t4!, temperature T4 in deg C ' t5!, temperature T5 in deg C ' 'Zachary Wolf '9/6/94, 12/2/94, 5/8/95 '**************************************************************************** 'Keep track of Ncall for header STATIC ncall% ncall% = ncall% + 1 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'On the first call, write the header IF ncall% = 1 THEN PRINT #filenum%, PRINT #filenum%, " Resistance and Temperature Measurements " PRINT #filenum%, PRINT #filenum%, "T1 = "; tmagt1nameP$ PRINT #filenum%, "T2 = "; tmagt2nameP$ PRINT #filenum%, "T3 = "; tmagt3nameP$ PRINT #filenum%, "T4 = "; tmagt4nameP$ PRINT #filenum%, "T5 = "; tmagt5nameP$ PRINT #filenum%, PRINT #filenum%, " Time Imag Vmag Rmag T1 T2 T3 T4 T5 " PRINT #filenum%, " (A) (V) (mohm) (deg C) (deg C) (deg C) (deg C) (deg C)" PRINT #filenum%, "-------- ------- ------- ------- ------- ------- ------- ------- -------" END IF 'Write the values PRINT #filenum%, USING "&"; tim$; PRINT #filenum%, USING " ####.##"; imag!; PRINT #filenum%, USING " ###.###"; vmag!; PRINT #filenum%, USING " ###.###"; rmag! * 1000!; PRINT #filenum%, USING " ####.##"; t1!; PRINT #filenum%, USING " ####.##"; t2!; PRINT #filenum%, USING " ####.##"; t3!; PRINT #filenum%, USING " ####.##"; t4!; PRINT #filenum%, USING " ####.##"; t5! 'Close the log file CLOSE filenum% END SUB SUB rtmain '**************************************************************************** 'This subroutine controls the resistance and temperature measurements. ' 'Zachary Wolf '9/6/94, 12/2/94, 1/5/95 '**************************************************************************** 'Message PRINT PRINT "Beginning the magnet resistance and temperature measurement cycle..." 'Get the desired current getinom: PRINT INPUT "What current do you wish to ramp to? (0 400 THEN PRINT : PRINT "The current must be between 0