'**************************************************************************** 'Module K7011 'This module contains subroutines which control the Keithley 7011 'multiplexer. ' 'Zachary Wolf '6/8/94 '**************************************************************************** 'Open the parameter file REM $INCLUDE: 'param.inc' 'The required parameters are in 'GPIB 'K7011 ' 'The required parameters are 'gpibinP% 'gpiboutP% 'k7011gpibaddrP% ' 'Sample K7011 parameters 'K7011 'CONST k7011gpibaddrP% = 7 'Keithley 7011 GPIB address SUB k7011closecc (card%, chan%) '**************************************************************************** 'This subroutine closes one channel of the Keithley 7011 multiplexer. ' 'Input: ' card%, the card number, 1 or 2 ' chan%, the channel number, 1 to 40 ' 'Zachary Wolf '6/6/94 '**************************************************************************** 'Put the address number into a string gpibaddr$ = LTRIM$(STR$(k7011gpibaddrP%)) 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN LF EOI" PRINT #gpiboutP%, "TERM OUT LF EOI" 'Check IF card% < 1 OR card% > 2 OR chan% < 1 OR chan% > 40 THEN PRINT : PRINT "k7011closecc: Problem with the Keithley 7011 input." STOP END IF 'Close the desired channel list$ = "(@" + LTRIM$(STR$(card%)) + "!" + LTRIM$(STR$(chan%)) + ")" PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";:CLOSE " + list$ 'Wait the specified time for the switch to close tstep! = TIMER WHILE TIMER - tstep! < .2 WEND END SUB SUB k7011init '**************************************************************************** 'This subroutine initializes the Keithley 7011 multiplexer card in the 'model 7001 chassis. ' 'Zachary Wolf '6/6/94 '**************************************************************************** 'Put the address number into a string gpibaddr$ = LTRIM$(STR$(k7011gpibaddrP%)) 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN LF EOI" PRINT #gpiboutP%, "TERM OUT LF EOI" 'Message PRINT PRINT "Resetting the Keithley 7011..." 'Clear the K7011 PRINT #gpiboutP%, "CLEAR " + gpibaddr$ 'Reset the 7011 PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";*RST" 'Clear the error registers PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";*CLS" 'Make sure all channels are open PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";:OPEN ALL" 'Display the ID PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";*IDN?" PRINT #gpiboutP%, "ENTER " + gpibaddr$ LINE INPUT #gpibinP%, id$ PRINT id$ END SUB SUB k7011openall '**************************************************************************** 'This subroutine opens all the channels of the Keithley 7011 multiplexer. ' 'Zachary Wolf '6/6/94 '**************************************************************************** 'Put the address number into a string gpibaddr$ = LTRIM$(STR$(k7011gpibaddrP%)) 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN LF EOI" PRINT #gpiboutP%, "TERM OUT LF EOI" 'Open all channels PRINT #gpiboutP%, "OUTPUT " + gpibaddr$ + ";:OPEN ALL" END SUB