DECLARE SUB tmaglogtn (logfile$, n%, tn!) DECLARE SUB hp3457ctc (c%, tc!) DECLARE SUB k7011closecc (card%, chan%) DECLARE SUB k7011openall () '**************************************************************************** 'Module TMAG 'This module contains drivers to measure magnet temperatures. ' 'Zachary Wolf '1/5/95 '**************************************************************************** 'Include the parameters used in the module REM $INCLUDE: 'param.inc' SUB tmaggettn (n%, tn!) '**************************************************************************** 'This subroutine gets a magnet temperature. ' 'Input: ' n%, identifier giving which temperature to measure ' 'Output: ' tn!, the measured magnet temperature ' 'Zachary Wolf '1/5/95 '**************************************************************************** 'Determine which multiplexer channel to use IF n% = 1 THEN c% = t1mxchanP% ELSEIF n% = 2 THEN c% = t2mxchanP% ELSEIF n% = 3 THEN c% = t3mxchanP% ELSEIF n% = 4 THEN c% = t4mxchanP% ELSEIF n% = 5 THEN c% = t5mxchanP% ELSE PRINT "TMAGGETTN: Unknown temperature requested." tn! = 0! EXIT SUB END IF 'Measure Tn CALL k7011closecc(mxcardP%, c%) 'close the multiplexer channel CALL hp3457ctc(mxhpchanP%, tn!) 'read the temperature CALL k7011openall 'open all multiplexer channels 'Log the result CALL tmaglogtn(logfileP$, n%, tn!) END SUB SUB tmaglogtn (logfile$, n%, tn!) '**************************************************************************** 'This subroutine writes a magnet temperature to the log file. ' 'Input: ' logfile$, the name of the log file ' n%, identifier giving which temperature ' tn!, the measured temperature ' 'Zachary Wolf '1/5/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print the results PRINT #filenum%, PRINT #filenum%, TIME$; " Temperature: Channel "; n%; ", T = "; vmag!; " deg C" 'Close the log file CLOSE filenum% END SUB