DECLARE SUB pmtempvstim () DECLARE SUB mmdatparam (logfile$) DECLARE SUB hhmeas () DECLARE SUB hhexit () DECLARE SUB hhinit () DECLARE SUB hhsetpar () DECLARE SUB mmcalibrate () DECLARE SUB mmmeas (projection%) DECLARE SUB mmsetpar (logfile$, datfile$, hhcoilradius!, hhG!, hhnturns%, nmeasave%, calcurhpchan%, calvtransperimag!, calcoilarea!) DECLARE SUB vtsetpar (logfile$, vtchan$, vtgain%, vtnpulseperrev%, vtnsampperrev%, vtnrevpermeas%, vtacc!, vtvel!, vtdis!) DECLARE SUB pmtsetpar (logfile$, datfile$, pmt1hpchan%, pmt2hpchan%, pmt3hpchan%, pmt1name$, pmt2name$, pmt3name$, pmtr25ctherm!, pmtdrdtat25ctherm!, pmttimbtwnmeassec%) DECLARE SUB gpibinit (gpibin%, gpibout%) DECLARE SUB pdiindexrd () DECLARE SUB pdiindexst (d$) DECLARE SUB pdiinit () DECLARE SUB pdisetpar (gpibin%, gpibout%, pdi5025addr$) DECLARE SUB pdivtrotencsetup (np%) DECLARE SUB cm2100avd (a!, v!, d!) DECLARE SUB cm2100init () DECLARE SUB cm2100setpar (gpibin%, gpibout%, cm2100addr$) DECLARE SUB hp3457init () DECLARE SUB hp3457setpar (gpibin%, gpibout%, hp3457addr$) DECLARE SUB fileinithh (project$, magtype$, magname$, run$, logfile$, datfile$, ok$) DECLARE SUB fileheadera (logfile$, project$, magtype$, magname$, coilname$, operator$, run$, comment$) DECLARE SUB gettestparama (projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) '**************************************************************************** 'Program HH 'This program makes measurements on permanent magnets in a Helmholtz coil. ' 'Zachary Wolf '9/12/95 '**************************************************************************** 'Include parameter file to assign parameters REM $INCLUDE: 'param.inc' 'Common blocks for run time parameters COMMON SHARED /filenames/ logfileP$, datfileP$ COMMON SHARED /testinfo/ projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$ COMMON SHARED /gpibio/ gpibinP%, gpiboutP% 'Print a message about the program CLS PRINT PRINT "*************************Program HH*****************************" PRINT "This program measures the magnetic moment of a magnet using" PRINT "a Helmholtz coil." 'Get test parameters from the operator testparam: CALL gettestparama(projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) 'Initialize the files for this run CALL fileinithh(projectP$, magtypeP$, magnameP$, runP$, logfileP$, datfileP$, ok$) IF ok$ <> "y" THEN PRINT PRINT "Problem initializing the data files." PRINT "Make sure you are using a new run number." GOTO testparam: END IF 'Establish communication with the GPIB CALL gpibinit(gpibinP%, gpiboutP%) 'Distribute parameters CALL hhsetpar 'Initialize all systems CALL hhinit 'OR (comment one out to make the .exe) ' 'Perform the measurements 'CALL hhmeas ' 'Measure the calibration magnet 'CALL mmcalibrate ' 'Measure the temperature vs time CALL pmtempvstim 'Get ready for exit CALL hhexit 'Message PRINT PRINT "The test is complete." END SUB hhexit '**************************************************************************** 'This subroutine gets the program ready to exit. ' 'Zachary Wolf '8/28/95 '**************************************************************************** END SUB SUB hhinit '**************************************************************************** 'This subroutine does all initialization for the Helmholtz coil measurements. ' 'Zachary Wolf '1/8/96 '**************************************************************************** 'Write headers to the log file and data file CALL fileheadera(logfileP$, projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) CALL fileheadera(datfileP$, projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) 'Write the Helmholtz coil parameters to the log and data files CALL mmdatparam(logfileP$) CALL mmdatparam(datfileP$) 'Initialize the PDI5025 CALL pdiinit 'Initialize the CM2100 CALL cm2100init 'Initialize the HP3457 CALL hp3457init 'Set the PDI5025 for rotary encoder triggering CALL pdivtrotencsetup(vtnpulseperrevP%) 'Perform an offset adjustment 'CALL pdioffset(vtchanP$, vtgainP%) 'Message PRINT PRINT "Locating the encoder index pulse..." 'Locate the index pulse CALL pdiindexst(vtrotdirP$) CALL cm2100avd(vtaccP!, vtvelP!, 2!) CALL pdiindexrd CALL cm2100avd(vtaccP!, vtvelP!, -2!) 'undo turns, for calib coil END SUB SUB hhmeas '**************************************************************************** 'This subroutine controls the magnetic measurements. ' 'Zachary Wolf '9/12/95 '**************************************************************************** 'Message PRINT PRINT "Beginning the magnetic moment measurement cycle..." 'Get the projection of mu in the x-y plane CALL mmmeas(1) 'Get the projection of mu in the y-z plane CALL mmmeas(2) END SUB SUB hhsetpar '**************************************************************************** 'This subroutine distributes required test parameters. ' 'Zachary Wolf '8/28/95, 1/8/96 '**************************************************************************** 'Set parameters for the stepping motor CALL cm2100setpar(gpibinP%, gpiboutP%, cm2100addrP$) 'Set parameters for the integrator CALL pdisetpar(gpibinP%, gpiboutP%, pdi5025addrP$) 'Set parameters for the HP3457 CALL hp3457setpar(gpibinP%, gpiboutP%, hp3457addrP$) 'Set parameters for the integrated voltage measurement module CALL vtsetpar(logfileP$, vtchanP$, vtgainP%, vtnpulseperrevP%, vtnsampperrevP%, vtnrevpermeasP%, vtaccP!, vtvelP!, vtdisP!) 'Set parameters for the magnetic moment module CALL mmsetpar(logfileP$, datfileP$, hhcoilradiusP!, hhGP!, hhnturnsP%, nmeasaveP%, calcurhpchanP%, calvtransperimagP!, calcoilareaP!) 'Set the parameters for the temperature measurement module CALL pmtsetpar(logfileP$, datfileP$, pmt1hpchanP%, pmt2hpchanP%, pmt3hpchanP%, pmt1nameP$, pmt2nameP$, pmt3nameP$, pmtr25cthermP!, pmtdrdtat25cthermP!, pmttimbtwnmeassecP%) END SUB