'**************************************************************************** 'Module PSHP3457 'This module contains I/O subroutines for the HP3457. Its primary use 'is monitoring transductor voltages for current measurements. ' 'Zachary Wolf '7/23/95 '**************************************************************************** 'Common area for shared parameters COMMON SHARED /pshp3457/ gpibinP%, gpiboutP%, pshp3457addrP$ SUB pshp3457cmon (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 ' 'Zachary Wolf '5/23/94 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF EOI" 'Preset the HP3457 PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";PRESET" 'Set the input source to rear terminal PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";TERM REAR" 'Set the channel to read PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";CHAN " + LTRIM$(STR$(c%)) 'Set the A/D integration time PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";NPLC 10" 'Trigger the reading PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";TRIG AUTO" END SUB SUB pshp3457cv (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 ' 'Zachary Wolf '4/21/94, 7/19/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF EOI" 'Preset the HP3457 PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";PRESET" 'Set the input source to rear terminal PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";TERM REAR" 'Set the channel to read PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";CHAN " + LTRIM$(STR$(c%)) 'Set the A/D integration time PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";NPLC 10" 'Trigger the reading PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";TRIG SGL" 'Get the reading PRINT #gpiboutP%, "ENTER " + pshp3457addrP$ INPUT #gpibinP%, v! END SUB SUB pshp3457err '**************************************************************************** 'This subroutine asks the HP3457 about any errors and prints the result. ' 'Zachary Wolf '8/14/94, 7/19/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF EOI" 'Any errors? PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";ERR?" PRINT #gpiboutP%, "ENTER " + pshp3457addrP$ INPUT #gpibinP%, a% PRINT "PSHP3457, ERR = "; a% END SUB SUB pshp3457init '**************************************************************************** 'This subroutine initializes the HP3457. ' 'Zachary Wolf '4/19/94, 5/19/95 '**************************************************************************** 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF EOI" 'Message PRINT PRINT "Resetting the PSHP3457..." 'Clear the HP3457 PRINT #gpiboutP%, "CLEAR " + pshp3457addrP$ 'Preset PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";PRESET" 'Display the ID PRINT #gpiboutP%, "OUTPUT " + pshp3457addrP$ + ";ID?" PRINT #gpiboutP%, "ENTER " + pshp3457addrP$ LINE INPUT #gpibinP%, id$ PRINT id$ END SUB SUB pshp3457setpar (gpibinf%, gpiboutf%, pshp3457addr$) '**************************************************************************** 'This subroutine sets up the parameters for the PSHP3457. ' 'Input: ' gpibinf%, gpib input file number ' gpiboutf%, gpib output file number ' pshp3457addr$, gpib address in a string ' 'Zachary Wolf '4/19/94, 5/19/95 '**************************************************************************** 'Make sure the input parameters have reasonable values IF gpibinf% < 0 OR gpibinf% > 100 THEN PRINT "PSHP3457: GPIB problem" EXIT SUB END IF IF gpiboutf% < 0 OR gpiboutf% > 100 THEN PRINT "PSHP3457: GPIB problem" EXIT SUB END IF IF pshp3457addr$ = "" THEN PRINT "PSHP3457: GPIB problem" EXIT SUB END IF 'Save the GPIB information in a common block for future use gpibinP% = gpibinf% gpiboutP% = gpiboutf% pshp3457addrP$ = pshp3457addr$ END SUB