DECLARE SUB iquadramp (rr!, inom!) DECLARE SUB vcoilgetf (f!) DECLARE SUB vcoilgetv3 (coilid%, v3!) DECLARE SUB blcalcratio (nh%, bln!(), sbln!(), nmain%, rn!(), srn!()) DECLARE SUB bldatblhar (datfile$, imag!, simag!, nmain%, nh%, bln!(), sbln!(), thn!(), sthn!(), r!(), sr!()) DECLARE SUB bldatview (logfile$, nmain%, thsp!, viewdir$) DECLARE SUB blgetblnav (nh%, bln!(), sbln!(), thn!(), sthn!()) DECLARE SUB blpltblhar (pltfile$, legend$, nh%, rn!(), srn!()) DECLARE SUB spolcalcxy (nh%, bln!(), sbln!(), thn!(), sthn!(), x!, sx!, y!, sy!) DECLARE SUB spolcheckpar (ok$) DECLARE SUB spoldatslvsi (datfile$, imag!, simag!, sl!, ssl!, tf!, stf!) DECLARE SUB spoldatxy (logfile$, thn!(), x!, sx!, y!, sy!) DECLARE SUB spolgetsl (sl!) DECLARE SUB spolgetslav (sl!, ssl!) DECLARE SUB spollogcalc (logfile$) DECLARE SUB spollogsl (logfile$, coilconst!, f!, v3!, sl!) DECLARE SUB spollogslav (logfile$, sl!, ssl!) DECLARE SUB spollogstrmeas (logfile$) DECLARE SUB spolpltslvsi (pltfile$, imag!, sl!, ssl!, tf!, stf!) DECLARE SUB imaggetiav (imag!, simag!) DECLARE SUB imagramp (inom!) DECLARE SUB filenewpage (filename$) '**************************************************************************** 'Module SPOL.BAS ' 'These subroutines perform calculations related to sextupole magnet 'measurements. ' 'Zachary Wolf '1/2/95 '**************************************************************************** 'Put the required parameters for this module in a common block COMMON SHARED /spol/ logfileP$, strdatfileP$, strpltfileP$, hardatfileP$, harpltfileP$, magnameP$, runP$, strcoilidP%, strspolcoilconstP!, harcoilradiusmP!, blnmeasaveP%, nimagtestP%, imagtestP!(), imagharflagP!(), nhardisplayP%, viewdirP$ SUB spolcalcxy (nh%, bln!(), sbln!(), thn!(), sthn!(), x!, sx!, y!, sy!) '**************************************************************************** 'This subroutine calculates the (x, y) position of the sextupole magnetic 'center relative to the coil axis. X is horizontal to the right (viewed 'from the encoder end) and Y is up. ' 'Input: ' nh%, the number of voltage harmonics recorded ' bln!(1 to nh%), the integrated strength of each harmonic at the coil radius (T) ' sbln!(1 to nh%), rms variation of bl ' thn!(1 to nh%), the angle of the first south pole of each harmonic wrt horizontal (deg) ' sthn!(1 to nh%), rms variation of th ' 'Output: ' x!, x coordinate of the magnetic center wrt the coil axis (m) ' sx!, calculated error for x ' y!, y coordinate of the magnetic center wrt the coil axis (m) ' sy!, calculated error for y ' 'Zachary Wolf '1/2/94 '**************************************************************************** 'Simplify the notation pi! = 3.1415926# 'Coil parameters rcoil! = harcoilradiusmP! 'Compute SL from bl(3) sl! = 2 * bln!(3) / rcoil! ^ 2 ssl! = 2 * sbln!(3) / rcoil! ^ 2 'Compute the magnetic center relative to the coil 'For a normal sextupole (th(3) = 30 deg): x! = -(bln!(2) / (sl! * rcoil!)) * SIN(2 * thn!(2) * pi! / 180!) y! = -(bln!(2) / (sl! * rcoil!)) * COS(2 * thn!(2) * pi! / 180!) 'With the leads reversed, the signs change IF thn!(3) < 0 THEN x! = -x! y! = -y! END IF 'Compute the error on the magnetic center sx! = ABS(x!) * SQR((ssl! / sl!) ^ 2 + (sbln!(2) / bln!(2)) ^ 2 + (COS(2 * thn!(2) * pi! / 180!) / (SIN(2 * thn!(2) * pi! / 180!) + .000001)) ^ 2 * (2 * sthn!(2) * pi! / 180!) ^ 2) sy! = ABS(y!) * SQR((ssl! / sl!) ^ 2 + (sbln!(2) / bln!(2)) ^ 2 + (SIN(2 * thn!(2) * pi! / 180!) / (COS(2 * thn!(2) * pi! / 180!) + .000001)) ^ 2 * (2 * sthn!(2) * pi! / 180!) ^ 2) END SUB SUB spolcheckpar (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" 'Files IF logfileP$ = "" OR strdatfileP$ = "" OR strpltfileP$ = "" OR hardatfileP$ = "" OR harpltfileP$ = "" THEN PRINT "SPOL: required file not defined" EXIT SUB END IF 'Runinfo IF magnameP$ = "" OR runP$ = "" THEN PRINT "SPOL: required run parameter not defined" EXIT SUB END IF 'Coil IF strcoilidP% <= 0 OR strspolcoilconstP! <= 0 OR harcoilradiusmP! <= 0 THEN PRINT "SPOL: required coil parameter not defined" EXIT SUB END IF 'Measurement parameters IF blnmeasaveP% <= 0 OR nhardisplayP% <= 0 OR nimagtestP% <= 0 THEN PRINT "SPOL: required measurement parameter not defined" EXIT SUB END IF 'Main harmonic picture IF viewdirP$ <> "LEADEND" AND viewdirP$ <> "NONLEADEND" THEN PRINT "SPOL: unknown view direction" EXIT SUB END IF 'If we made it this far, all parameters have values ok$ = "y" END SUB SUB spoldatslvsi (datfile$, imag!, simag!, sl!, ssl!, tf!, stf!) '**************************************************************************** 'This subroutine writes an SL measurement at Imag to the data file. ' 'Input: ' datfile$, the name of the data file ' imag!, the measured current ' simag!, the standard deviation of imag ' sl!, the integrated sextupole strength at the measured current ' ssl!, the standard deviation of SL ' tf!, SL/I ' stf!, the standard deviation of TF ' 'Zachary Wolf '8/14/94, 1/4/95 '**************************************************************************** 'Keep track of Ncall so a header can be written on the first call STATIC ncall% ncall% = ncall% + 1 'Open the log file filenum% = FREEFILE OPEN datfile$ FOR APPEND AS filenum% 'On the first call, write a header for the hysteresis loop IF ncall% = 1 THEN PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, " INTEGRATED SEXTUPOLE STRENGTH VS CURRENT" PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, " Imag sigImag SL sigSL SL/I sigSL/I " PRINT #filenum%, " (A) (A) (T/m) (T/m) (T/m/A) (T/m/A) " PRINT #filenum%, "--------+-------- --------+-------- --------+--------" END IF 'Write the result PRINT #filenum%, USING "####.###"; imag!; PRINT #filenum%, USING " ####.###"; simag!; PRINT #filenum%, USING " ####.###"; sl!; PRINT #filenum%, USING " ####.###"; ssl!; PRINT #filenum%, USING " ###.####"; tf!; PRINT #filenum%, USING " ###.####"; stf! 'Close the log file CLOSE filenum% END SUB SUB spoldatxy (logfile$, thn!(), x!, sx!, y!, sy!) '**************************************************************************** 'This subroutine writes the (x, y) location of the magnetic center 'relative to the coil to the log file. ' 'Input: ' logfile$, file to print results ' thn!(1 to nh%), gives the orientation of the sextupole field ' x!, x position of the magnetic center wrt the coil axis ' sx!, error on x ' y!, y position of the magnetic center wrt the coil axis ' sy!, error on y ' 'Zachary Wolf '1/4/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print the magnetic center to the log file PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, "The magnetic center is at" PRINT #filenum%, "X = "; PRINT #filenum%, USING "#####.#"; x! * 1000000!; PRINT #filenum%, " +- "; PRINT #filenum%, USING "#####.#"; sx! * 1000000!; PRINT #filenum%, " microns" PRINT #filenum%, "Y = "; PRINT #filenum%, USING "#####.#"; y! * 1000000!; PRINT #filenum%, " +- "; PRINT #filenum%, USING "#####.#"; sy! * 1000000!; PRINT #filenum%, " microns" PRINT #filenum%, PRINT #filenum%, "The magnetic center is measured relative to the coil axis" PRINT #filenum%, "effectively at the longitudinal center of the magnet." PRINT #filenum%, "Pitch and yaw are not seen by the coil." 'Print the following diagram 'PRINT #filenum%, 'PRINT #filenum%, "View from the non-lead end of the magnet:" 'PRINT #filenum%, 'IF thn!(3) > 0 THEN ' PRINT #filenum%, " y " ' PRINT #filenum%, " ^ " ' PRINT #filenum%, " | " ' PRINT #filenum%, " N " ' PRINT #filenum%, " S S " ' PRINT #filenum%, " --> x " ' PRINT #filenum%, " N N " ' PRINT #filenum%, " S " 'ELSE ' PRINT #filenum%, " y " ' PRINT #filenum%, " ^ " ' PRINT #filenum%, " | " ' PRINT #filenum%, " S " ' PRINT #filenum%, " N N " ' PRINT #filenum%, " --> x " ' PRINT #filenum%, " S S " ' PRINT #filenum%, " N " 'END IF 'Close the log file CLOSE filenum% END SUB SUB spolgetsl (sl!) '**************************************************************************** 'This subroutine calculates the integrated sextupole strength from the 'measured coil voltage at the third harmonic. ' 'Output: ' sl!, the integrated sextupole strength (T/m) ' 'Zachary Wolf '11/19/95 '**************************************************************************** 'Make sure all parameters have been defined with acceptable values CALL spolcheckpar(ok$) IF ok$ <> "y" THEN EXIT SUB 'Calculation Of SL: 'V3 = Nturns * velocity * B3 * L ' = Nturns * Rcoil * ang_freq * 1/2 * SL * Rcoil^2 ' = Nturns * Rcoil^3 * ang_freq * 1/2 * SL 'SL = 2 * V3 / (Nturns * Rcoil^3 * ang_freq) 'For a double coil (for coil bowing correction), 'V3 = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2] * ang_freq * 1/2 * SL 'SL = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2]^(-1) * (2 * V3 / ang_freq) 'Let CoilConst = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2]^(-1) 'SL = CoilConst * 2 * V3 / ang_freq 'Simplify the notation pi! = 3.1415926# 'Measure the coil rotation frequency CALL vcoilgetf(f1!) SLEEP 1 CALL vcoilgetf(f2!) 'Get the coil voltage at the second harmonic CALL vcoilgetv3(strcoilidP%, v3!) 'Measure the coil rotation frequency again after the coil voltage CALL vcoilgetf(f3!) 'Compute the average of the coil rotation frequency measurements f! = (f1! + f2! + f3!) / 3! 'Compute SL sl! = strspolcoilconstP! * 2 * v3! / (2 * pi! * f!) 'Log the result CALL spollogsl(logfileP$, strspolcoilconstP!, f!, v3!, sl!) END SUB SUB spolgetslav (sl!, ssl!) '**************************************************************************** 'This subroutine has SL measured several times, then it computes the 'average and rms variation. ' 'Output: ' sl!, average of the SL measurements ' ssl!, rms variation of the SL measurements ' 'Zachary Wolf '11/21/95 '**************************************************************************** 'Make sure all parameters have been defined with acceptable values CALL spolcheckpar(ok$) IF ok$ <> "y" THEN EXIT SUB 'Log that a strength measurement is being made CALL spollogstrmeas(logfileP$) 'Simplify the notation nm% = blnmeasaveP% 'Initialize data arrays DIM slmeas!(1 TO nm%) 'Message about the measurement number PRINT PRINT "Performing SL measurement #"; 'Loop over the measurements FOR i% = 1 TO nm% 'Message about the measurement number PRINT USING " #"; i%; 'Measure SL CALL spolgetsl(sl!) 'Store the results slmeas!(i%) = sl! 'End the loop over the measurements NEXT i% 'End message info PRINT 'Compute averages sl! = 0! FOR i% = 1 TO nm% sl! = sl! + slmeas!(i%) NEXT i% sl! = sl! / nm% 'Compute rms deviations ssl! = 0! FOR i% = 1 TO nm% ssl! = ssl! + (slmeas!(i%) - sl!) ^ 2 NEXT i% ssl! = SQR(ssl! / nm%) 'Print the result to the screen PRINT "Integrated Sextupole Strength SL = "; sl!; " +- "; ssl!; " T/m" 'Log the result CALL spollogslav(logfileP$, sl!, ssl!) END SUB SUB spollogcalc (logfile$) '**************************************************************************** 'This subroutine summarizes the calculations used in the program. ' 'Inputs: ' logfile$, the name of the log file ' 'Zachary Wolf '9/22/94, 12/3/94, 5/4/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Header PRINT #filenum%, PRINT #filenum%, " SUMMARY OF THE CALCULATIONS AND CONVENTIONS USED" 'Summarize the calculations used for SL vs I PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, "Calculation Of SL:" PRINT #filenum%, "V3 = Nturns * velocity * B3 * L" PRINT #filenum%, " = Nturns * Rcoil * ang_freq * 1/2 * SL * Rcoil^2" PRINT #filenum%, " = Nturns * Rcoil^3 * ang_freq * 1/2 * SL" PRINT #filenum%, "SL = 2 * V3 / (Nturns * Rcoil^3 * ang_freq)" PRINT #filenum%, "For a double coil (for coil bowing correction)," PRINT #filenum%, "V3 = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2] * ang_freq * 1/2 * SL" PRINT #filenum%, "SL = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2]^(-1) * (2 * V3 / ang_freq)" PRINT #filenum%, "Let CoilConst = [(Nturns * Rcoil^3)1 + (Nturns * Rcoil^3)2]^(-1)" PRINT #filenum%, "SL = CoilConst * 2 * V3 / ang_freq" 'Harmonics PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, "Calculation Of The Harmonics:" PRINT #filenum%, "Magnitude, harmonic n:" PRINT #filenum%, "Vn = Nturns * velocity * Bn * L" PRINT #filenum%, " = Nturns * Rcoil * ang_freq * (BLn)" PRINT #filenum%, "BLn = Vn / (Nturns * Rcoil * ang_freq)" PRINT #filenum%, "Rn = BLn / BL3 = Vn / V3" PRINT #filenum%, PRINT #filenum%, "Phase, harmonic n:" PRINT #filenum%, "At the coil radius, the radial field as a function of angle is," PRINT #filenum%, "BLn(th) = BLn * cos(n*(th - THspole))" PRINT #filenum%, "The coil voltage Vn(th) = Nturns * velocity * BLn(th)" PRINT #filenum%, "Vn(th) = Nturns * Rcoil * ang_freq * BLn * cos(n*(th - THspole))" PRINT #filenum%, "The FFT gives Vn and PhiVn in the formula" PRINT #filenum%, "Vn(i) = Vn * cos(n*2pi*i/N + PhiVn)" PRINT #filenum%, "So, Nturns * Rcoil * ang_freq * BLn = Vn" PRINT #filenum%, " -n * THspole = PhiVn" PRINT #filenum%, "Or, BLn = Vn / (Nturns * Rcoil * ang_freq)" PRINT #filenum%, " THspole = -PhiVn / n" 'Magnetic center calculations PRINT #filenum%, PRINT #filenum%, PRINT #filenum%, "Calculation Of The Sextupole Center:" PRINT #filenum%, "In the sextupole's frame," PRINT #filenum%, " Bx' = S * x' * y'" PRINT #filenum%, " By' = 1/2 * S * (x'^2 - y'^2)." PRINT #filenum%, "In the coil's frame (unprimed frame) the magnetic center is at (x0, y0)." PRINT #filenum%, "In the coil's frame," PRINT #filenum%, " Bx = S * (x - x0) * (y - y0)" PRINT #filenum%, " By = 1/2 * S * [(x - x0)^2 - (y - y0)^2]." PRINT #filenum%, "The magnetic center can be found in terms of the measured" PRINT #filenum%, "quadrupole field. Compare Br and Btheta on the x-axis to" PRINT #filenum%, " Bxquad = -S * (x0 * y + y0 * x)" PRINT #filenum%, " Byquad = -S * (x0 * x - y0 * y)." PRINT #filenum%, "Evaluate at x = Rcoil, y = 0 and compare to" PRINT #filenum%, " Br(theta = 0) = Bx, Btheta(theta = 0) = By." PRINT #filenum%, "In terms of the measured integrated strengths, this gives" PRINT #filenum%, " Xcenter = x0 = - (1/(SL * Rcoil)) * BL2 * sin(2 * THspole2)" PRINT #filenum%, " Ycenter = y0 = - (1/(SL * Rcoil)) * BL2 * cos(2 * THspole2)" 'Close the log file CLOSE filenum% END SUB SUB spollogsl (logfile$, coilconst!, f!, v3!, sl!) '**************************************************************************** 'This subroutine writes a summary of an SL measurement to the log file. ' 'Input: ' logfile$, the name of the log file ' coilconst!, coil constant ' f!, coil rotation frequency ' v3!, coil voltage at the third harmonic ' sl!, integrated sextupole strength ' 'Zachary Wolf '11/19/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print the results PRINT #filenum%, TIME$; " Integrated Sextupole Strength Measurement:" PRINT #filenum%, " CoilConst = "; coilconst!; " 1/m^3, Fcoil = "; f!; " Hz, V3 = "; v3!; " V" PRINT #filenum%, " SL = "; sl!; " T/m" 'Close the log file CLOSE filenum% END SUB SUB spollogslav (logfile$, sl!, ssl!) '**************************************************************************** 'This subroutine writes a summary of an average SL measurement to the log file. ' 'Input: ' logfile$, the name of the log file ' sl!, the average of the integrated sextupole strength measurements ' ssl!, the rms variation of sl ' 'Zachary Wolf '11/19/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print the results PRINT #filenum%, TIME$; " Average Integrated Sextupole Strength:" PRINT #filenum%, " SL = "; sl!; " +- "; ssl!; " T/m" 'Close the log file CLOSE filenum% END SUB SUB spollogstrmeas (logfile$) '**************************************************************************** 'This subroutine records a measurement to the log file. ' 'Input: ' logfile$, the name of the log file ' 'Zachary Wolf '11/25/95 '**************************************************************************** 'Open the log file filenum% = FREEFILE OPEN logfile$ FOR APPEND AS filenum% 'Print the results PRINT #filenum%, PRINT #filenum%, TIME$; " Magnet Strength Measurement..." 'Close the log file CLOSE filenum% END SUB SUB spolmain '**************************************************************************** 'This subroutine controls the magnetic measurements of a sextupole at 'various currents. ' 'Zachary Wolf '1/4/95, 5/6/95 '**************************************************************************** 'Make sure all parameters have been defined with acceptable values CALL spolcheckpar(ok$) IF ok$ <> "y" THEN EXIT SUB 'Message PRINT PRINT "Beginning the sextupole field measurement cycle..." 'Simplify the notation ni% = nimagtestP% nh% = nhardisplayP% 'Initialize data arrays DIM bln!(1 TO nh%) 'field strength at Rcoil of the n'th harmonic DIM sbln!(1 TO nh%) 'standard deviation of Bn DIM thn!(1 TO nh%) 'field angle DIM sthn!(1 TO nh%) 'standard deviation of THn DIM rn!(1 TO nh%) 'BLn/BL3 DIM srn!(1 TO nh%) 'standard deviation of rn 'Set the quadrupole coil current iquad! = 500! CALL iquadramp(0!, iquad!) 'Loop over test currents FOR i% = 1 TO ni% 'Ramp to the desired current CALL imagramp(imagtestP!(i%)) 'Measure the current CALL imaggetiav(imag!, simag!) 'Get the integrated sextupole strength CALL spolgetslav(sl!, ssl!) 'Compute the transfer function IF imag! <> 0! THEN tf! = sl! / imag! stf! = tf! * SQR((ssl! / sl!) ^ 2 + (simag! / imag!) ^ 2) ELSE tf! = 0! stf! = 0! END IF 'Write the strength measurement to the data file CALL spoldatslvsi(strdatfileP$, imag!, simag!, sl!, ssl!, tf!, stf!) 'Write the strength measurement to the plot file CALL spolpltslvsi(strpltfileP$, imag!, sl!, ssl!, tf!, stf!) 'Do the following only if the harmonics are desired IF imagharflagP!(i%) > 0 THEN 'Get the field harmonics at the coil radius CALL blgetblnav(nh%, bln!(), sbln!(), thn!(), sthn!()) 'Compute the strength ratios of the harmonics CALL blcalcratio(nh%, bln!(), sbln!(), nmain%, rn!(), srn!()) 'Compute the location of the magnetic center CALL spolcalcxy(nh%, bln!(), sbln!(), thn!(), sthn!(), x!, sx!, y!, sy!) 'Write the harmonics to the data file CALL bldatblhar(hardatfileP$, imag!, simag!, nmain%, nh%, bln!(), sbln!(), thn!(), sthn!(), rn!(), srn!()) 'Write a picture of the main harmonic under the table of harmonics CALL bldatview(hardatfileP$, nmain%, thn!(nmain%), viewdirP$) 'Write the magnetic center to the data file CALL spoldatxy(hardatfileP$, thn!(), x!, sx!, y!, sy!) 'Write the harmonics to the plot file legend$ = "I = " + STR$(imagtestP!(i%)) + " A" CALL blpltblhar(harpltfileP$, legend$, nh%, rn!(), srn!()) 'End harmonics check END IF 'End loop over currents NEXT i% 'Write a summary of the calculations to the SL data file CALL filenewpage(strdatfileP$) CALL spollogcalc(strdatfileP$) 'Write a summary of the calculations to the harmonics data file CALL filenewpage(hardatfileP$) CALL spollogcalc(hardatfileP$) END SUB SUB spolpltslvsi (pltfile$, imag!, sl!, ssl!, tf!, stf!) '**************************************************************************** 'This subroutine write a summary of the sl vs I measurements for plotting. ' 'Input: ' pltfile$, the name of the plot file ' imag!, the measured current ' sl!, the integrated sextupole strength at the measured current ' ssl!, the standard deviation of sl ' tf!, the transfer function at the measured current ' stf!, the standard deviation of tf ' 'Zachary Wolf '7/16/94, 5/6/95 '**************************************************************************** 'Keep track of Ncall for the header STATIC ncall% ncall% = ncall% + 1 'Open the plot file filenum% = FREEFILE OPEN pltfile$ FOR APPEND AS filenum% 'Write the title for plotting on the first call IF ncall% = 1 THEN PRINT #filenum%, "/et g '" + magnameP$ + ", Run " + runP$ + "'" PRINT #filenum%, ";i sl ssl tf stf" END IF 'Write the values PRINT #filenum%, USING "####.#"; imag!; PRINT #filenum%, USING " ####.###"; sl!; PRINT #filenum%, USING " ####.###"; ssl!; PRINT #filenum%, USING " ###.#####"; tf!; PRINT #filenum%, USING " ###.#####"; stf! 'Close the log file CLOSE filenum% END SUB SUB spolsetpar (logfile$, strdatfile$, strpltfile$, hardatfile$, harpltfile$, magname$, run$, strcoilid%, strspolcoilconst!, harcoilradiusm!, blnmeasave%, nimagtest%, imagtest!(), imagharflag!(), nhardisplay%, viewdir$) '**************************************************************************** 'This subroutine sets the parameters required by this module. ' 'Input: ' logfile$, path and name of the log file ' strdatfile$, magnet strength data file ' strpltfile$, magnet strength plot file ' hardatfile$, harmonics data file ' harpltfile$, harmonics plot file ' magname$, magnet name ' run$, run number ' strcoilid%, strength coil ID number ' strspolcoilconst!, strength coil quadrupole coil constant ' harcoilradiusm!, harmonics coil radius (m) ' blnmeasave%, number of measurements for averaging ' nimagtest%, number of test currents ' imagtest!(), test currents ' imagharflag!(), flag for harmonics measurement ' nhardisplay%, number of harmonics to record ' viewdir$, view direction for picture of main harmonic ' 'Zachary Wolf '11/20/95 '**************************************************************************** 'Set the parameters logfileP$ = logfile$ strdatfileP$ = strdatfile$ strpltfileP$ = strpltfile$ hardatfileP$ = hardatfile$ harpltfileP$ = harpltfile$ magnameP$ = magname$ runP$ = run$ strcoilidP% = strcoilid% strspolcoilconstP! = strspolcoilconst! harcoilradiusmP! = harcoilradiusm! blnmeasaveP% = blnmeasave% nimagtestP% = nimagtest% DIM imagtestP!(1 TO nimagtestP%) DIM imagharflagP!(1 TO nimagtestP%) FOR i% = 1 TO nimagtestP% imagtestP!(i%) = imagtest!(i%) imagharflagP!(i%) = imagharflag!(i%) NEXT i% nhardisplayP% = nhardisplay% viewdirP$ = viewdir$ END SUB