'Open the parameter file REM $INCLUDE: 'param.inc' SUB hp3457cmon (c%) '**************************************************************************** 'This routine displays the voltage applied to a specified channel of the 'HP3457 DVM on the front panel. Voltages can be monitored while the 'program is running. ' 'Input: c%, the DVM channel to read and display ' 'Inputs from param.inc: ' gpibinP%, GPIB input file number ' gpiboutP%, GPIB output file number ' hp3457addrP%, the HP3457 GPIB address ' 'Zachary Wolf '5/23/94 '**************************************************************************** 'Get the GPIB I/O file numbers and the HP3457 address from the parameters gpibin% = gpibinP% gpibout% = gpiboutP% hp3457addr% = hp3457addrP% 'Put the address number into a string hp3457addr$ = STR$(hp3457addr%) 'Set the GPIB terminators PRINT #gpibout%, "TERM IN CR LF" PRINT #gpibout%, "TERM OUT CR LF EOI" 'Preset the HP3457 PRINT #gpibout%, "output " + hp3457addr$ + "; PRESET" 'Set the input source to rear terminal PRINT #gpibout%, "output " + hp3457addr$ + "; TERM REAR" 'Set the channel to read PRINT #gpibout%, "output " + hp3457addr$ + "; CHAN " + STR$(c%) 'Set the A/D integration time PRINT #gpibout%, "output " + hp3457addr$ + "; NPLC 10" 'Trigger the reading PRINT #gpibout%, "output " + hp3457addr$ + "; TRIG AUTO" 'Get the reading PRINT #gpibout%, "enter " + hp3457addr$ INPUT #gpibin%, v! END SUB SUB hp3457cntv (c%, n%, t!, v!()) '**************************************************************************** 'This subroutine takes n voltage readings spaced t seconds apart and returns 'the values. ' 'Input: ' c%, the DVM channel to read ' n%, the number of voltage samples ' t!, the time between voltage samples ' 'Output: ' v!(0 to n%-1), the measured voltages ' 'Inputs from param.inc: ' gpibinP%, GPIB input file number ' gpiboutP%, GPIB output file number ' hp3457addrP%, the HP3457 GPIB address ' 'Zachary Wolf '4/21/94 '**************************************************************************** 'Get the GPIB I/O file numbers and the HP3457 address from the parameters gpibin% = gpibinP% gpibout% = gpiboutP% hp3457addr% = hp3457addrP% 'Put the address number into a string hp3457addr$ = STR$(hp3457addr%) 'Set the GPIB terminators PRINT #gpibout%, "TERM IN CR LF" PRINT #gpibout%, "TERM OUT CR LF EOI" 'Preset the HP3457 PRINT #gpibout%, "output " + hp3457addr$ + "; PRESET" 'Set the input source to rear terminal PRINT #gpibout%, "output " + hp3457addr$ + "; TERM REAR" 'Set the channel PRINT #gpibout%, "output " + hp3457addr$ + "; CHAN " + STR$(c%) 'Set the voltage range PRINT #gpibout%, "output " + hp3457addr$ + "; DCV 3" 'Set the A/D integration time PRINT #gpibout%, "output " + hp3457addr$ + "; NPLC .1" 'Turn off the autozero PRINT #gpibout%, "output " + hp3457addr$ + "; AZERO OFF" 'Turn off the display PRINT #gpibout%, "output " + hp3457addr$ + "; DISP OFF" 'Set the timer PRINT #gpibout%, "output " + hp3457addr$ + "; TIMER " + STR$(t!) 'Send the readings to the memory PRINT #gpibout%, "output " + hp3457addr$ + "; MSIZE " + STR$(n% * 4 + 10) PRINT #gpibout%, "output " + hp3457addr$ + "; MEM FIFO" 'Trigger the reading PRINT #gpibout%, "output " + hp3457addr$ + "; TARM AUTO" PRINT #gpibout%, "output " + hp3457addr$ + "; NRDGS " + STR$(n%) + ", TIMER" PRINT #gpibout%, "output " + hp3457addr$ + "; TRIG SGL" 'Get the readings FOR i% = 0 TO n% - 1 PRINT #gpibout%, "enter " + hp3457addr$ INPUT #gpibin%, v!(i%) NEXT i% END SUB SUB hp3457cv (c%, v!) '**************************************************************************** 'This routine reads the voltage applied to a specified channel of the 'HP3457 DVM. ' 'Input: c%, the DVM channel to read ' 'Output: v!, the measured voltage ' 'Inputs from param.inc: ' gpibinP%, GPIB input file number ' gpiboutP%, GPIB output file number ' hp3457addrP%, the HP3457 GPIB address ' 'Zachary Wolf '4/21/94 '**************************************************************************** 'Get the GPIB I/O file numbers and the HP3457 address from the parameters gpibin% = gpibinP% gpibout% = gpiboutP% hp3457addr% = hp3457addrP% 'Put the address number into a string hp3457addr$ = STR$(hp3457addr%) 'Set the GPIB terminators PRINT #gpibout%, "TERM IN CR LF" PRINT #gpibout%, "TERM OUT CR LF EOI" 'Preset the HP3457 PRINT #gpibout%, "output " + hp3457addr$ + "; PRESET" 'Set the input source to rear terminal PRINT #gpibout%, "output " + hp3457addr$ + "; TERM REAR" 'Set the channel to read PRINT #gpibout%, "output " + hp3457addr$ + "; CHAN " + STR$(c%) 'Set the A/D integration time PRINT #gpibout%, "output " + hp3457addr$ + "; NPLC 10" 'Trigger the reading PRINT #gpibout%, "output " + hp3457addr$ + "; TRIG SGL" 'Get the reading PRINT #gpibout%, "enter " + hp3457addr$ INPUT #gpibin%, v! END SUB SUB hp3457init '**************************************************************************** 'This subroutine initializes the HP3457. ' 'Inputs from param.inc: ' gpibinP%, GPIB input file number ' gpiboutP%, GPIB output file number ' hp3457addrP%, the HP3457 GPIB address ' 'Zachary Wolf '4/19/94 '**************************************************************************** 'Get the GPIB I/O file numbers and the HP3457 address from the parameters gpibin% = gpibinP% gpibout% = gpiboutP% hp3457addr% = hp3457addrP% 'Put the address number into a string hp3457addr$ = STR$(hp3457addr%) 'Set the GPIB terminators PRINT #gpibout%, "TERM IN CR LF" PRINT #gpibout%, "TERM OUT CR LF EOI" 'Message PRINT PRINT "Resetting the HP3457..." 'Clear the HP3457 PRINT #gpibout%, "clear " + hp3457addr$ 'Preset PRINT #gpibout%, "output " + hp3457addr$ + "; PRESET" 'Display the ID PRINT #gpibout%, "output " + hp3457addr$ + "; ID?" PRINT #gpibout%, "enter " + hp3457addr$ INPUT #gpibin%, id$ PRINT id$ END SUB