Step 9 - Read The Measurement; The Complete Application Program - National Instruments GPIB-PCII Getting Started

Hide thumbs Also See for GPIB-PCII:
Table of Contents

Advertisement

Writing an Advanced Program Using NI-488.2 Routines
Step 9 – Read the Measurement
Use the Receive function to read the measurement over the IEEE-488 bus.
Again, the first argument is the GPIB interface board number, and the second
argument is the IEEE-488 address of the multimeter. The third argument is a
string into which the Receive function places the data bytes from the
multimeter. The last argument specifies that the Receive function is to
terminate upon receiving a byte accompanied with the END message. The loop
is then repeated. The average value is printed at the end of the 10
measurements.
CALL Receive(0, fluke%, Reading$, STOPend)
IF IBSTA% < 0 THEN
CALL gpiberr("Receive error")
CALL IBONL (0,0)
STOP
END IF
PRINT "Reading: "; Reading$
SUM = SUM + VAL(Reading$)
NEXT M%
PRINT "The average of the 10 readings is", SUM/10
CALL IBONL (0,0)
END

The Complete Application Program

The following program combines the previous steps into one program.
REM $INCLUDE: 'C:\GPIB-PC\QBDECL.BAS'
DECLARE SUB gpiberr (msg$)
DIM instruments% (31)
DIM result% (31)
DIM Reading AS STRING*30
CLS
CALL SendIFC(0)
IF IBSTA% < 0 THEN
CALL gpiberr("SendIFC(0) error")
CALL IBONL (0,0)
STOP
END IF
PCII/IIA and NI-488.2 MS-DOS
3-8
© National Instruments Corp.
Chapter 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gpib-pciia181065-01181065-02

Table of Contents