DECLARE SUB par5209err (ynerr$) DECLARE SUB gpibclrdev (addr$) DECLARE SUB par5209datready () DECLARE SUB par5209ready () DECLARE SUB gpibin (addr$, msg$) DECLARE SUB gpibout (addr$, cmd$) DECLARE SUB gpibspoll (addr$, msg$) DECLARE SUB gpibterm (termin$, termout$) '**************************************************************************** 'Module PAR5209 'This module contains I/O subroutines for the Princeton Applied Research 'Model 5209 lock-in amplifier. ' 'Zachary Wolf '3/12/96 '**************************************************************************** 'Common area for shared parameters COMMON SHARED /par5209/ gpibinP%, gpiboutP%, par5209addrP$ 'Semi-permanent parameters CONST par5209terminP$ = "CR LF EOI" CONST par5209termoutP$ = "CR LF" SUB par5209automeas '**************************************************************************** 'This subroutine has the PAR 5209 lock-in amplifier perform an auto-measure 'command. ' 'Zachary Wolf '3/12/96 '**************************************************************************** END SUB SUB par5209datready '**************************************************************************** 'This subroutine is used to verify that the 5209 is done processing and 'has data ready to return. It checks the serial poll bits and 'waits until the 5209 is ready to send its output. ' 'Zachary Wolf '3/12/96 '**************************************************************************** END SUB SUB par5209err (ynerr$) '**************************************************************************** 'This subroutine is used to check for an error condition (overflow, command 'error, etc.). ' 'Output: ' ynerr$, "y" if there is an error, "n" if there is no error ' 'Zachary Wolf '3/26/96 '**************************************************************************** 'Default ynerr$ = "n" END SUB SUB par5209getfreq (freq!) '**************************************************************************** 'This subroutine has the PAR 5209 lock-in amplifier return the reference 'frequency. ' 'Output: ' freq!, reference frequency in Hz ' 'Zachary Wolf '3/12/96 '**************************************************************************** END SUB SUB par5209getrphase (phase!) '**************************************************************************** 'This subroutine has the PAR 5209 lock-in amplifier return the reference 'phase angle. ' 'Zachary Wolf '3/13/96 '**************************************************************************** END SUB SUB par5209getvrms (vrms!) '**************************************************************************** 'This subroutine has the PAR 5209 lock-in amplifier return the rms magnitude 'of the input signal. ' 'Output: ' vrms!, the input signal magnitude in volts rms ' 'Zachary Wolf '3/14/96 '**************************************************************************** END SUB SUB par5209init '**************************************************************************** 'This subroutine initializes the PAR 5209 lock-in amplifier. ' 'Zachary Wolf '3/12/96 '**************************************************************************** END SUB SUB par5209ready '**************************************************************************** 'This subroutine is used to verify that the 5209 is done processing a command 'and is ready for the next command. It checks the serial poll bits and 'waits until the 5209 is ready for the next command. ' 'Zachary Wolf '3/12/96 '**************************************************************************** END SUB SUB par5209setpar (gpibinf%, gpiboutf%, par5209addr$) '**************************************************************************** 'This subroutine sets parameter values for the PAR 5209 lock-in amplifier. ' 'Input: ' gpibinf%, GPIB input file number ' gpiboutf%, GPIB output file number ' par5209addr$, the PAR5209 GPIB address in a string ' 'Zachary Wolf '3/12/96 '**************************************************************************** 'Make sure all GPIB parameters have reasonable values IF gpibinf% < 0 OR gpibinf% > 100 THEN PRINT "PAR5209: GPIB problem" EXIT SUB END IF IF gpiboutf% < 0 OR gpiboutf% > 100 THEN PRINT "PAR5209: GPIB problem" EXIT SUB END IF IF par5209addr$ = "" THEN PRINT "PAR5209: GPIB problem" EXIT SUB END IF 'Place the parameters in the local common block for future use gpibinP% = gpibinf% gpiboutP% = gpiboutf% par5209addrP$ = par5209addr$ END SUB