DECLARE SUB gpibinit (gpibin%, gpibout%) ' 'Short program to test offset adjustment ' 'Parameter definitions pdi5025addrP$ = "13" 'Initialize the GPIB CALL gpibinit(gpibinP%, gpiboutP%) 'Set the GPIB terminators PRINT #gpiboutP%, "TERM IN CR LF" PRINT #gpiboutP%, "TERM OUT CR LF" 'Use the encoder for triggers PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";TRS,E,1024" 'Select the integrator channel PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";CHA,A" 'Set the gain PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";SGA,10" 'Message PRINT PRINT "PDI-5025 Offset Adjustment" 'Put the PDI-5025 in offset adjustment mode PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";ADJ,A,1:" 'Get the register 1 status bits in a string PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";STB,1" PRINT #gpiboutP%, "ENTER " + pdi5025addrP$ LINE INPUT #gpibinP%, statbits$ PRINT PRINT "After begin offset adjust, register 1 = "; statbits$ 'Have the user adjust the offset PRINT PRINT "Adjust the offset screw on channel A" PRINT "until the integrator value is 000." INPUT "Press ENTER when finished.", a$ 'End offset adjustment mode PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";ADJ,A,0" 'Get the register 1 status bits in a string PRINT #gpiboutP%, "OUTPUT " + pdi5025addrP$ + ";STB,1" PRINT #gpiboutP%, "ENTER " + pdi5025addrP$ LINE INPUT #gpibinP%, statbits$ PRINT PRINT "After end offset adjust, register 1 = "; statbits$