EasyManua.ls Logo

BK Precision 5492 - Page 88

BK Precision 5492
118 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
88
CALL ibclr(dvm%)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibclr Error")
' Reset the meter by issuing the reset (*RST) command. Instruct the
' meter to measure the volts alternating current (VAC) using auto-ranging (AUTO).
' If the error bit EERR is set in IBSTA%, call GPIBERR with an error message.
wrt$ = "*RST"
CALL ibwrt(dvm%, wrt$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt Error")
wrt$ = "CONF:VOLT:AC"
CALL ibwrt(dvm%, wrt$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt Error")
' Initialize the accumulator of the 10 measurements to zero.
sum = 0!
' Establish FOR loop to read the 10 measurements. The variable i% will
' serve as a counter for the FOR loop.
FOR i% = 1 TO 10
' Request the measurement by sending the instruction
' "READ?". If the error bit EERR is set in IBSTA%, call GPIBERR
' with an error message.
wrt$ = "READ?"
CALL ibwrt(dvm%, wrt$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt Error")
' Read the meter measurement. If the error bit EERR is set in
' IBSTA%, call GPIBERR with an error message.
rd$ = SPACE$(11)
CALL ibrd(dvm%, rd$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibrd Error")
' Remove blank spaces in RD$ and assign resulting buffer to READING$.
' Print measurement returned by the meter.
reading$ = LEFT$(rd$, ibcnt%)
PRINT "reading: "; reading$
' Convert READING$ to its numeric value and add to the accumulator.
sum = sum + VAL(reading$)
NEXT i% ' Continue FOR loop until 10 measurements are read.
' Print the average of the 10 readings.
PRINT "The average of the 10 readings is: ", sum / 10
' Call the IBONL function to disable the hardware and software.

Table of Contents

Related product manuals