DECLARE SUB dac488hrdo0 (d%) DECLARE SUB dac488hrdo1 (d%) DECLARE SUB hp3457cv (c%, v!) DECLARE SUB dac488hrinit () DECLARE SUB dac488hrsetpar (gpibinf%, gpiboutf%, dac488hraddr$) DECLARE SUB coilinit () DECLARE SUB gpibinit (gpibin%, gpibout%) DECLARE SUB dac488init () DECLARE SUB dac488setpar (gpibin%, gpibout%, dac488addr$) DECLARE SUB hp3457init () DECLARE SUB hp3457setpar (gpibin%, gpibout%, hp3457addr$) DECLARE SUB vcoilgetv (coilid%, n%, v!()) DECLARE SUB vcoilgetvfft (coilid%, n%, fftm!(), fftp!()) DECLARE SUB vcoilgetvhar (coilid%, nh%, harm!(), harp!()) DECLARE SUB vcoilsetpar (logfile$, coilnsampperrev%, coilnrevpermeas%, coilfreqhpchan%, strcoilhpchan%, harcoilhpchan%, strcoilid%, harcoilid%) DECLARE SUB spplotfft (ns%, fftm!(), fftp!()) DECLARE SUB spplothar (nh%, harm!(), harp!()) DECLARE SUB spplotsamp (ns%, samp!()) DECLARE SUB fileinitlog (logfile$) '**************************************************************************** 'Program COIL 'This program is used to make rotating coil measurements in dipoles, 'quadrupoles, and sextupoles. ' 'Zachary Wolf '11/20/95 '**************************************************************************** 'Common area for run time parameters COMMON SHARED /gpibio/ gpibinP%, gpiboutP% COMMON SHARED /filenames/ logfileP$, strdatfileP$, hardatfileP$, strpltfileP$, harpltfileP$ COMMON SHARED /testinfo/ projectP$, magtypeP$, magnameP$, barcodeP$, teststandP$, coilnameP$, operatorP$, runP$, commentP$ 'Include the constants used in the program 'Execute assignment statements REM $INCLUDE: 'param.inc' 'Prepare the screen CLS 'Print a message about the program PRINT PRINT "Program COIL" PRINT "This program performs rotating coil measurements in dipoles," PRINT "quadrupoles, and sextupoles." PRINT "These measurements give magnet strengths and harmonics." 'Initialize the software and hardware CALL coilinit 'Measure a voltage 'CALL hp3457cv(0, v!) 'PRINT "V0 = "; v! 'Check the reset signal 'CALL dac488hrdo1(1) 'SLEEP 1 'CALL dac488hrdo0(1) 'SLEEP 1 'STOP 'Message PRINT PRINT "Sampling the coil voltage..." 'Plot the coil voltage samples PRINT "1" n% = coilnsampperrevP% * coilnrevpermeasP% 'PRINT "n = "; n% DIM v!(0 TO n% - 1) CALL vcoilgetv(harcoilidP%, n%, v!()) CALL spplotsamp(n%, v!()) 'Plot the FFT of the coil voltage samples PRINT "2" DIM fftm!(0 TO n% / 2) DIM fftp!(0 TO n% / 2) CALL vcoilgetvfft(harcoilidP%, n%, fftm!(), fftp!()) CALL spplotfft(n%, fftm!(), fftp!()) 'Plot the voltage harmonics PRINT "3" nh% = 16 DIM harm!(1 TO nh%) DIM harp!(1 TO nh%) CALL vcoilgetvhar(harcoilidP%, nh%, harm!(), harp!()) CALL spplothar(nh%, harm!(), harp!()) 'Message PRINT "The measurement is complete." END SUB coilinit '**************************************************************************** 'This subroutine does all the initialization for the program. 'Most parameters come from param.inc. ' 'Zachary Wolf '9/20/95 '**************************************************************************** 'Hardware init 'Initialize the GPIB CALL gpibinit(gpibinP%, gpiboutP%) 'Set the parameters for the HP3457 CALL hp3457setpar(gpibinP%, gpiboutP%, hp3457addrP$) CALL hp3457init 'Set the parameters for the DAC488 (used for Reset) 'CALL dac488setpar(gpibinP%, gpiboutP%, dac488addrP$) 'CALL dac488init 'Set the parameters for the DAC488HR CALL dac488hrsetpar(gpibinP%, gpiboutP%, dac488hraddrP$) CALL dac488hrinit 'Software init CALL fileinitlog(logfileP$) 'Set parameters for the coil voltage measurements CALL vcoilsetpar(logfileP$, coilnsampperrevP%, coilnrevpermeasP%, coilfreqhpchanP%, strcoilhpchanP%, harcoilhpchanP%, strcoilidP%, harcoilidP%) END SUB