DECLARE SUB gpibclr () '**************************************************************************** 'Module LS450 'This module contains subroutines to read the Lake Shore Model 450 'teslameter. ' 'Zachary Wolf '6/12/94 '**************************************************************************** 'Common area for shared parameters COMMON SHARED /ls450/ gpibinP%, gpiboutP%, ls450addrP$ SUB ls450getb (b!) '**************************************************************************** 'This subroutine has the Lake Shore Model 450 teslameter measure the 'magnetic field. ' 'Output: ' b!, the measured magnetic field strength in Tesla ' 'Zachary Wolf '6/12/94 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF" 'Make sure the meter is ready to send data stb% = 0 WHILE NOT stb% AND 1 'Bit 0 is Field Data Ready PRINT #gpiboutP%, "SPOLL " + ls450addrP$ INPUT #gpibinP%, stb% ' PRINT stb% WEND 'Make sure the meter is not overloaded PRINT #gpiboutP%, "SPOLL " + ls450addrP$ INPUT #gpibinP%, stb% IF stb% AND 16 THEN 'Bit 4 is Overload Indicator PRINT "The Gaussmeter is overloaded!" b! = 0! EXIT SUB END IF 'Check that the reading will have appropriate units PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + "; UNIT?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ INPUT #gpibinP%, units$ IF units$ <> "T" THEN PRINT "The Gaussmeter units are not Tesla, exiting." b! = 0! EXIT SUB END IF 'Get the reading PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + "; FIELD?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ INPUT #gpibinP%, b! 'Get the multiplier PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + "; FIELDM?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ INPUT #gpibinP%, mult$ IF mult$ = "u" THEN b! = b! / 1000000! ELSEIF mult$ = "m" THEN b! = b! / 1000! ELSEIF mult$ = "k" THEN b! = b! * 1000! ELSEIF mult$ = "" THEN b! = b! ELSE PRINT "Unknown field multiplier: "; mult$ b! = 0! EXIT SUB END IF 'After the SPOLL, clear the GPIB for the extenders CALL gpibclr END SUB SUB ls450init '**************************************************************************** 'This subroutine initializes the Lake Shore 450 Gaussmeter. ' 'Zachary Wolf '12/11/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF" 'Message PRINT PRINT "Resetting the Lake Shore 450 Gaussmeter..." 'Reset the LS450 PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";*RST" 'Put Gaussmeter in DC measurement mode PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";ACDC 0" 'Turn off digital filtering PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";FILT 0" 'Set the units to Tesla PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";UNIT T" 'Turn on max-hold PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";MAX 1" 'Turn on autoranging PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";AUTO 1" 'Turn on field compensation PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";FCOMP 1" 'Turn on temperature compensation PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";TCOMP 1" 'Turn off relative mode PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";REL 0" 'Turn off alarms PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";ALARM 0" 'Set bits in the standard event status enable register PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";*ESE 189" 'turn on all bits 'Set bits in the status byte enable register PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";*SRE 55" 'turn on bits 0,1,2,4,5 'Display the Gaussmeter ID PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";*IDN?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ LINE INPUT #gpibinP%, id$ PRINT id$ 'Display the probe serial number PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";SNUM?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ LINE INPUT #gpibinP%, snum$ PRINT "Probe: "; snum$ 'Display the probe type PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + ";TYPE?" PRINT #gpiboutP%, "ENTER " + ls450addrP$ LINE INPUT #gpibinP%, type$ PRINT "Type: "; type$ END SUB SUB ls450setpar (gpibinf%, gpiboutf%, ls450addr$) '**************************************************************************** 'This subroutine initializes the Lake Shore 450 Gaussmeter. ' 'Input: ' gpibinf%, gpib input file number ' gpiboutf%, gpib output file number ' ls450addr$, gpib address in a string ' 'Zachary Wolf '12/11/95 '**************************************************************************** 'Make sure the input parameters have reasonable values IF gpibinf% < 0 OR gpibinf% > 100 THEN PRINT "LS450: GPIB problem" EXIT SUB END IF IF gpiboutf% < 0 OR gpiboutf% > 100 THEN PRINT "LS450: GPIB problem" EXIT SUB END IF IF ls450addr$ = "" THEN PRINT "LS450: GPIB problem" EXIT SUB END IF 'Save the GPIB information in a common block for future use gpibinP% = gpibinf% gpiboutP% = gpiboutf% ls450addrP$ = ls450addr$ END SUB SUB ls450setrange (r%) '**************************************************************************** 'This subroutine sets the range of the Lake Shore 450 Gaussmeter. 'For the high stability probes: ' r% = 0 is the 300 kG range ' r% = 1 is the 30 kG range ' r% = 2 is the 3 kG range ' r% = 3 is the 300 G range ' 'Input: ' r%, the range number ' 'Zachary Wolf '12/11/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF" 'Set the measurement range PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + "; RANGE " + LTRIM$(STR$(r%)) END SUB SUB ls450zero '**************************************************************************** 'This subroutine zeros the Lake Shore 450 Gaussmeter. ' 'Zachary Wolf '12/11/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF" 'Message PRINT PRINT "Lake Shore 450 Gaussmeter Zero" PRINT "Please place the Hall probe into a 0 Gauss chamber." INPUT "Press ENTER when ready. ", a$ PRINT "Zeroing the Lake Shore 450 Gaussmeter..." 'Zero the Gaussmeter PRINT #gpiboutP%, "OUTPUT " + ls450addrP$ + "; ZCAL" 'Wait until the zeroing is finished SLEEP 18 'Message PRINT "The Hall probe is zeroed." END SUB