DECLARE SUB pdisetgain (g%) DECLARE SUB vtlocateindex () DECLARE SUB hhgettestparam (projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) 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$) '**************************************************************************** '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 hhgettestparam(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 '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 '**************************************************************************** 'Set the integrator gain to 1 CALL pdisetgain(1) END SUB SUB hhgettestparam (projectP$, magtypeP$, magnameP$, coilnameP$, operatorP$, runP$, commentP$) '**************************************************************************** 'This subroutine prompts the operator for the magnet name and other 'parameters of the test. ' 'Output: ' projectP$, name of the project ' magtypeP$, magnet type ' magnameP$, name of magnet (serial #) ' coilnameP$, the ID of the measurement coil ' operatorP$, name of the operator doing the test ' runP$, run number ' commentP$, comment about the test ' 'Zachary Wolf '7/8/94, 5/8/95, 7/26/95, 7/11/96 '**************************************************************************** begina: 'Get the project name PRINT 'PRINT "What is the name of the project the magnet is for? " 'PRINT "(8 characters or less): ["; projectP$; "]"; 'INPUT project$ 'project$ = UCASE$(project$) 'IF project$ <> "" THEN projectP$ = project$ projectP$ = "PEP2INT" 'Get the magnet type 'PRINT "What is the magnet type (q1d, q1q)? " 'PRINT "(8 characters or less): ["; magtypeP$; "]"; 'INPUT magtype$ 'magtype$ = UCASE$(magtype$) 'IF magtype$ <> "" THEN magtypeP$ = magtype$ magtypeP$ = "PMBLOCKS" 'Get the name of the magnet PRINT "What is the name (serial #) of the PM block?" PRINT "(8 characters or less): ["; magnameP$; "]"; INPUT magname$ magname$ = UCASE$(magname$) IF magname$ <> "" THEN magnameP$ = magname$ 'Get the name of the measurement coil 'PRINT "Enter the name of the measurement coil or system: ["; coilnameP$; "] "; 'INPUT "", coil$ 'coil$ = UCASE$(coil$) 'IF coil$ <> "" THEN coilnameP$ = coil$ coilnameP$ = "HH Coil" 'Get the operator's name(s) PRINT "Enter the operator(s) name(s): ["; operatorP$; "] "; INPUT "", operator$ IF operator$ <> "" THEN operatorP$ = operator$ 'Get the run number PRINT "What is the run number (1, 2, 3, ...): ["; runP$; "]"; INPUT run$ IF run$ <> "" THEN runP$ = run$ 'Get a comment PRINT "Enter any comment about the run: ["; commentP$; "]"; LINE INPUT comment$ IF comment$ <> "" THEN commentP$ = comment$ 'See if everything was entered correctly PRINT INPUT "Do you wish to make any changes to the values entered (Y or N): ", yn$ IF yn$ = "Y" OR yn$ = "y" THEN GOTO begina 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%) 'Locate the index pulse CALL vtlocateindex 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