DECLARE SUB teletracdelay () DECLARE SUB teletracsetrange (r%) '**************************************************************************** 'Module TELETRAC 'This module contains subroutines to read the Teletrac 14000 interferometer. ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Common area for shared parameters COMMON SHARED /teletrac/ gpibinP%, gpiboutP%, teletracaddrP$ 'Semi-permanent parameters CONST teletracterminP$ = "CR LF EOI" CONST teletractermoutP$ = "CR EOI" SUB teletracdelay '**************************************************************************** 'This subroutine adds a delay to allow for command processing time. ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Wait for 60 msec t0! = TIMER WHILE TIMER - t0! < .06 WEND END SUB SUB teletracgetx (x!) '**************************************************************************** 'This subroutine has the Teletrac 14000 interferometer return the X position. ' 'Output: ' x!, the measured X position in cm ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Set the GPIB terminators CALL gpibterm(teletracterminP$, teletractermoutP$) 'Get the reading CALL gpibout(teletracaddrP$, "QX") CALL teletracdelay CALL gpibin(teletracaddrP$, xpos$) 'PRINT "xpos$ = "; xpos$ x! = VAL(xpos$) END SUB SUB teletracgety (y!) '**************************************************************************** 'This subroutine has the Teletrac 14000 interferometer return the Y position. ' 'Output: ' y!, the measured Y position in cm ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Set the GPIB terminators CALL gpibterm(teletracterminP$, teletractermoutP$) 'Get the reading CALL gpibout(teletracaddrP$, "QY") CALL teletracdelay CALL gpibin(teletracaddrP$, ypos$) 'PRINT "ypos$ = "; ypos$ y! = VAL(ypos$) END SUB SUB teletracinit '**************************************************************************** 'This subroutine initializes the Teletrac 14000 interferometer. ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Set the GPIB terminators CALL gpibterm(teletracterminP$, teletractermoutP$) 'Message PRINT PRINT "Resetting the Teletrac 14000 interferometer..." 'Put in remote mode CALL gpibout(teletracaddrP$, "RE") FOR i% = 1 TO 6 CALL teletracdelay NEXT i% 'Set the X axis + direction CALL gpibout(teletracaddrP$, "DXU") CALL teletracdelay 'Set the Y axis + direction CALL gpibout(teletracaddrP$, "DYU") CALL teletracdelay 'Set units to cm CALL gpibout(teletracaddrP$, "UM") CALL teletracdelay 'Turn on the smooth function to reduce vibration effects CALL gpibout(teletracaddrP$, "SY") CALL teletracdelay 'Query the interferometer as a status check CALL gpibout(teletracaddrP$, "R?") CALL teletracdelay CALL gpibin(teletracaddrP$, status$) PRINT status$ END SUB SUB teletracsetpar (gpibinf%, gpiboutf%, teletracaddr$) '**************************************************************************** 'This subroutine initializes the Teletrac 14000 interferometer. ' 'Input: ' gpibinf%, gpib input file number ' gpiboutf%, gpib output file number ' teletracaddr$, gpib address in a string ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Make sure the input parameters have reasonable values IF gpibinf% < 0 OR gpibinf% > 100 THEN PRINT "TELETRAC: GPIB problem" EXIT SUB END IF IF gpiboutf% < 0 OR gpiboutf% > 100 THEN PRINT "TELETRAC: GPIB problem" EXIT SUB END IF IF teletracaddr$ = "" THEN PRINT "TELETRAC: GPIB problem" EXIT SUB END IF 'Save the GPIB information in a common block for future use gpibinP% = gpibinf% gpiboutP% = gpiboutf% teletracaddrP$ = teletracaddr$ END SUB SUB teletraczerox '**************************************************************************** 'This subroutine zeros the Teletrac 14000 X channel. ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Set the GPIB terminators CALL gpibterm(teletracterminP$, teletractermoutP$) 'Zero the X channel CALL gpibout(teletracaddrP$, "ZX") CALL teletracdelay END SUB SUB teletraczeroy '**************************************************************************** 'This subroutine zeros the Teletrac 14000 Y channel. ' 'Zachary Wolf '4/22/98 '**************************************************************************** 'Set the GPIB terminators CALL gpibterm(teletracterminP$, teletractermoutP$) 'Zero the Y channel CALL gpibout(teletracaddrP$, "ZY") CALL teletracdelay END SUB