DECLARE SUB hp3457cmon (c%) DECLARE SUB hp3457cv (c%, v!) DECLARE SUB imanramp (inom!) DECLARE SUB imancheckpar (ok$) '**************************************************************************** 'Module IMAN 'This module contains drivers to set and measure the magnet current manually. ' 'Zachary Wolf '9/4/95 '**************************************************************************** 'Common block for this module's parameters COMMON SHARED /iman/ imaghpchanP%, vtransperimagP! SUB imancheckpar (ok$) '**************************************************************************** 'This subroutine checks that all required parameters have been assigned 'values. ' 'Output: ' ok$, "y" if parameter assignments are ok, "n" otherwise ' 'Zachary Wolf '9/18/95 '**************************************************************************** 'Default value ok$ = "n" 'imaghpchanP% IF imaghpchanP% < 0 OR imaghpchanP% > 9 THEN PRINT "IMAN: imaghpchan has improper value" EXIT SUB END IF 'vtransperimagP! IF vtransperimagP! <= 0 OR vtransperimagP! > 10 THEN PRINT "IMAN: vtransperimag has improper value" EXIT SUB END IF 'If we made it this far, all parameters have values ok$ = "y" END SUB SUB imangeti (imag!) '**************************************************************************** 'This subroutine gets the transductor output voltage. It then applies 'the calibration constant to get the magnet current. ' 'Output: ' imag!, the measured magnet current ' 'Zachary Wolf '4/21/94, 1/5/95, 7/28/95 '**************************************************************************** 'Make sure all parameters have been set CALL imancheckpar(ok$) IF ok$ <> "y" THEN PRINT "IMAN: problem with parameters" imag! = 0! EXIT SUB END IF 'Measure the voltage from the transductor CALL hp3457cv(imaghpchanP%, v!) 'Apply the conversion factor imag! = v! / vtransperimagP! END SUB SUB imaninit '**************************************************************************** 'This subroutine sets the parameters in the common blocks required 'to control the magnet current. ' 'Zachary Wolf '7/31/95 '**************************************************************************** 'Nothing needs to be done for manual ramping. END SUB SUB imanmonitor '**************************************************************************** 'This subroutine sets up the HP3457 to monitor the transductor. ' 'Zachary Wolf '9/4/95 '**************************************************************************** 'Make sure all parameters have been set CALL imancheckpar(ok$) IF ok$ <> "y" THEN PRINT "IMAN: problem with parameters" EXIT SUB END IF 'Set the DVM so the current can be monitored CALL hp3457cmon(imaghpchanP%) END SUB SUB imanramp (inom!) '**************************************************************************** 'This subroutine supervises the ramp of the magnet current. ' 'Input: ' inom!, the desired magnet current ' 'Zachary Wolf '1/1/95 '**************************************************************************** 'Ramp PRINT PRINT "Please ramp to "; inom!; " A." INPUT "Press ENTER when ready. ", a$ END SUB SUB imansetpar (imaghpchan%, vtransperimag!) '**************************************************************************** 'This subroutine sets parameters for manual current operation. ' 'Input: ' imaghpchan%, HP3457 channel to read transductor voltage ' vtransperimag!, transductor voltage per amp in the magnet ' 'Zachary Wolf '12/4/95 '**************************************************************************** 'Place the parameters in the common area imaghpchanP% = imaghpchan% vtransperimagP! = vtransperimag! END SUB