DECLARE SUB hp3457ctc (c%, tc!) DECLARE SUB k7011closecc (card%, chan%) DECLARE SUB k7011openall () DECLARE SUB tmaglogtn (logfile$, n%, tn!) '**************************************************************************** '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' 'The required parameters are 'logfileP$ 'tmagt1mxchanP% 'tmagt2mxchanP% 'tmagt3mxchanP% 'tmagt4mxchanP% 'tmagt5mxchanP% 'tmagmxcardP% 'tmagmxhpchanP% ' 'The required parameters are in 'FILE 'TMAG ' 'Sample TMAG parameters 'TMAG 'CONST tmagmxhpchanP% = 4 'HP3457 channel for the multiplexer 'CONST tmagmxcardP% = 1 'K7011 card number 'CONST tmagt1mxchanP% = 12 'K7011 T1 channel 'CONST tmagt1nameP$ = "Water In" 'CONST tmagt2mxchanP% = 13 'K7011 T2 channel 'CONST tmagt2nameP$ = "Water Out" 'CONST tmagt3mxchanP% = 14 'K7011 T3 channel 'CONST tmagt3nameP$ = "Magnet Iron" 'CONST tmagt4mxchanP% = 15 'K7011 T4 channel 'CONST tmagt4nameP$ = "Magnet Coil" 'CONST tmagt5mxchanP% = 31 'K7011 T5 channel 'CONST tmagt5nameP$ = "Ambient" 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% = tmagt1mxchanP% ELSEIF n% = 2 THEN c% = tmagt2mxchanP% ELSEIF n% = 3 THEN c% = tmagt3mxchanP% ELSEIF n% = 4 THEN c% = tmagt4mxchanP% ELSEIF n% = 5 THEN c% = tmagt5mxchanP% ELSE PRINT "TMAGGETTN: Unknown temperature requested." tn! = 0! EXIT SUB END IF 'Measure Tn CALL k7011closecc(tmagmxcardP%, c%) 'close the multiplexer channel CALL hp3457ctc(tmagmxhpchanP%, 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 = "; tn!; " deg C" 'Close the log file CLOSE filenum% END SUB