DECLARE SUB vtgetvthar1 (rotdir$, vtmag!, vtphase!) DECLARE SUB mmmeas (projection%) DECLARE SUB hhexit () DECLARE SUB hhinit () DECLARE SUB hhsetpar () DECLARE SUB mmcalibrate () DECLARE SUB mmdatmuav (logfile$, proj%, mu!, smu!, th!, sth!) DECLARE SUB mmgetmuav (mu!, smu!, th!, sth!) 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 pmtdattemp (logfile$, temp!) DECLARE SUB pmtgettblock (temp!) DECLARE SUB pmtsetpar (logfile$, datfile$, pmt1hpchan%, pmt2hpchan%, pmt3hpchan%, pmt1name$, pmt2name$, pmt3name$, pmtr25ctherm!, pmtdrdtat25ctherm!, pmttimbtwnmeassec%) DECLARE SUB gpibinit (ieeein%, ieeeout%) DECLARE SUB pdiindexrd () DECLARE SUB pdiindexst (d$) DECLARE SUB pdiinit () DECLARE SUB pdisetpar (gpibinf%, gpiboutf%, pdi5025addr$) DECLARE SUB pdivtrotencsetup (np%) DECLARE SUB cm2100avd (a!, v!, d!) DECLARE SUB cm2100init () DECLARE SUB cm2100setpar (gpibinf%, gpiboutf%, cm2100addr$) DECLARE SUB hp3457init () DECLARE SUB hp3457setpar (gpibinf%, gpiboutf%, hp3457addr$) '**************************************************************************** 'Program TEST '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$, pltfileP$ COMMON SHARED /testinfo/ projectP$, magtypeP$, magnameP$, barcodeP$, teststandP$, 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 permanent magnet" PRINT "using a Helmholtz coil." 'Initialize the log file for the run filenum% = FREEFILE logfileP$ = "logfile.dat" OPEN logfileP$ FOR OUTPUT AS filenum% CLOSE filenum% 'Initialize the dat file for the run filenum% = FREEFILE datfileP$ = "datfile.dat" OPEN datfileP$ FOR OUTPUT AS filenum% CLOSE filenum% 'Establish communication with the GPIB CALL gpibinit(gpibinP%, gpiboutP%) 'Distribute parameters CALL hhsetpar 'Initialize all systems CALL hhinit 'Perform a move 'CALL cm2100avdst(vtaccP!, vtvelP!, vtdisP!) 'PRINT "Started move..." 'CALL cm2100avdend(vtdisP!) 'STOP 'Calibrate CALL mmcalibrate STOP 'Measure a component of the magnetic moment 'CALL mmmeas(1) 'STOP 'Measure temperatures 'CALL pmtgettn(1, t1!) 'CALL pmtgettn(2, t2!) 'PRINT "T1 = "; t1!; ", T2 = "; t2! CALL pmtgettblock(temp!) 'STOP 'Message 'PRINT 'PRINT "Measuring VT fundamental..." 'Get the integrated voltage harmonic at the fundamental frequency rotdir$ = "+" CALL vtgetvthar1(rotdir$, vtmag!, vtphase!) STOP 'Make a measurement in the CW and CCW directions 'PRINT 'PRINT "Measuring in the CW and CCW directions..." 'CALL mmgetmu(mu!, th!) 'STOP 'Perform a measurement CALL mmgetmuav(mu!, smu!, th!, sth!) '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 fileheader(logfileP$, projectP$, magtypeP$, magnameP$, barcodeP$, teststandP$, coilnameP$, operatorP$, runP$, commentP$) 'CALL fileheader(datfileP$, projectP$, magtypeP$, magnameP$, barcodeP$, teststandP$, coilnameP$, operatorP$, runP$, commentP$) '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("+") CALL cm2100avd(vtaccP!, vtvelP!, 2!) CALL pdiindexrd CALL cm2100avd(vtaccP!, vtvelP!, -2!) 'Undo rotations, for calibrations 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 'Place the magnet PRINT PRINT "Please place the magnet in position 1." INPUT "Press ENTER when ready.", a$ 'Perform the measurement CALL mmgetmuav(mu!, smu!, th!, sth!) 'Get the block temperature CALL pmtgettblock(temp!) 'Store the result CALL mmdatmuav(datfileP$, 1, mu!, smu!, th!, sth!) CALL pmtdattemp(datfileP$, temp!) 'Get the projection of mu in the x-z plane 'Place the magnet PRINT PRINT "Please place the magnet in position 2." INPUT "Press ENTER when ready.", a$ 'Perform the measurement CALL mmgetmuav(mu!, smu!, th!, sth!) 'Get the block temperature CALL pmtgettblock(temp!) 'Store the result CALL mmdatmuav(datfileP$, 2, mu!, smu!, th!, sth!) CALL pmtdattemp(datfileP$, temp!) 'Get the projection of mu in the y-z plane 'Place the magnet PRINT PRINT "Please place the magnet in position 3." INPUT "Press ENTER when ready.", a$ 'Perform the measurement CALL mmgetmuav(mu!, smu!, th!, sth!) 'Get the block temperature CALL pmtgettblock(temp!) 'Store the result CALL mmdatmuav(datfileP$, 3, mu!, smu!, th!, sth!) CALL pmtdattemp(datfileP$, temp!) 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