DECLARE SUB tmaglogtn (logfile$, n%, tn!) DECLARE SUB hp3457ctc (c%, tc!) '**************************************************************************** '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 temperature to measure IF n% = 1 THEN c% = t1hpchanP% ELSEIF n% = 2 THEN c% = t2hpchanP% ELSEIF n% = 3 THEN c% = t3hpchanP% ELSE PRINT "TMAGGETTN: Unknown temperature requested." tn! = 0! EXIT SUB END IF 'Measure Tn CALL hp3457ctc(c%, tn!) '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