DECLARE SUB hp3457cv (c%, v!) DECLARE SUB k7011closecc (card%, chan%) DECLARE SUB k7011openall () DECLARE SUB vmaglogv (logfile$, vmag!) '**************************************************************************** 'Module VMAG 'This module contains drivers to measure the magnet voltage. ' 'Zachary Wolf '1/5/95 '**************************************************************************** 'Include the parameters used in the module REM $INCLUDE: 'param.inc' 'The required parameters are 'logfileP$ 'vmagmxcardP% 'vmagmxchanP% 'vmagmxhpchanP% ' 'The required parameters are in 'FILE 'VMAG ' 'Sample VMAG parameters 'VMAG 'CONST vmagmxhpchanP% = 4 'HP3457 channel for the multiplexer 'CONST vmagmxcardP% = 1 'K7011 card number 'CONST vmagmxchanP% = 11 'K7011 magnet voltage channel SUB vmaggetv (vmag!) '**************************************************************************** 'This subroutine gets the magnet voltage. ' 'Output: ' vmag!, the measured magnet voltage ' 'Zachary Wolf '1/5/95 '**************************************************************************** 'Measure the magnet voltage CALL k7011closecc(vmagmxcardP%, vmagmxchanP%) 'close the multiplexer channel CALL hp3457cv(vmagmxhpchanP%, vmag!) CALL k7011openall 'open all multiplexer channels 'Log the result CALL vmaglogv(logfileP$, vmag!) END SUB SUB vmaglogv (logfile$, vmag!) '**************************************************************************** 'This subroutine writes the magnet voltage to the log file. ' 'Input: ' logfile$, the name of the log file ' vmag!, the measured magnet voltage ' '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$; " Magnet Voltage, Vmag = "; vmag!; " V" 'Close the log file CLOSE filenum% END SUB