DECLARE SUB tbabcheckpar (ok$) DECLARE SUB tbabloggett (logfile$, id%, temp!) DECLARE SUB hp3457ctc (c%, tc!) '**************************************************************************** 'Module TBAB 'This module contains routines to measure various mapper temperatures. ' 'Zachary Wolf '2/9/98 '**************************************************************************** 'Common block for this module's parameters COMMON SHARED /tbab/ logfileP$, temp1hpchanP%, temp2hpchanP% SUB tbabcheckpar (ok$) '**************************************************************************** 'This subroutine checks that all required parameters have been assigned 'values. ' 'Output: ' ok$, "y" if parameter assignments are ok, "n" otherwise ' 'Zachary Wolf '2/9/98 '**************************************************************************** 'Default value ok$ = "n" 'logfileP$ IF logfileP$ = "" THEN PRINT "TBAB: log file undefined" EXIT SUB END IF 'temp1hpchanP% IF temp1hpchanP% < 0 OR temp1hpchanP% > 9 THEN PRINT "TBAB: temp1hpchan has improper value" EXIT SUB END IF 'temp2hpchanP% IF temp2hpchanP% < 0 OR temp2hpchanP% > 9 THEN PRINT "TBAB: temp2hpchan has improper value" EXIT SUB END IF 'If we made it this far, all parameters have values ok$ = "y" END SUB SUB tbabgett (id%, temp!) '**************************************************************************** 'This subroutine gets the requested temperature. ' 'Input: ' id%, temperature sensor ID number ' 'Output: ' temp!, the measured temperature (deg C) ' 'Zachary Wolf '2/9/98 '**************************************************************************** 'Make sure all parameters have been set CALL tbabcheckpar(ok$) IF ok$ <> "y" THEN PRINT "TBAB: problem with parameters" temp! = 0! EXIT SUB END IF 'Measure the requested temperature IF id% = 1 THEN CALL hp3457ctc(temp1hpchanP%, temp!) ELSEIF id% = 2 THEN CALL hp3457ctc(temp2hpchanP%, temp!) ELSE PRINT "TBAB: unknown ID number" temp! = 0! END IF 'Log the result CALL tbabloggett(logfileP$, id%, temp!) END SUB SUB tbabinit '**************************************************************************** 'Babar temperature module initialization. ' 'Zachary Wolf '7/31/95 '**************************************************************************** 'Nothing needs to be done for manual ramping. END SUB SUB tbabloggett (logfile$, id%, temp!) '**************************************************************************** 'This subroutine records the measured temperature to the log file. ' 'Input: ' logfile$, the name of the log file ' id%, current sensor ID number ' temp!, measured temperature (deg C) ' 'Zachary Wolf '2/9/98 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Write the field strength PRINT #filenum%, TIME$; " Temperature Sensor ID = "; id%; ", T = "; PRINT #filenum%, USING "###.#####"; temp!; PRINT #filenum%, " C" 'Close the log file CLOSE filenum% END SUB SUB tbabsetpar (logfile$, temp1hpchan%, temp2hpchan%) '**************************************************************************** 'This subroutine sets parameters for Babar temperature measurements. ' 'Input: ' logfile$, log file ' temp1hpchan%, HP3457 channel to read temperature ' temp2hpchan%, HP3457 channel to read temperature ' 'Zachary Wolf '2/9/98 '**************************************************************************** 'Place the parameters in the common area logfileP$ = logfile$ temp1hpchanP% = temp1hpchan% temp2hpchanP% = temp2hpchan% END SUB