BASICA/QuickBASIC GPIB-PC Function Calls
Section Four A
GPIB-PC User Manual
4A-112
©National Instruments Corp.
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Send the GET message to trigger a
REM measurement reading.
REM
CMD$ = CHR$(&H8) : CALL IBCMD (BRD0%,CMD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Wait for the DVM to set SRQ or for a
REM timeout; if the current time limit
REM is too short, use IBTMO to change it.
REM
MASK% = &H5000
CALL IBWAIT (BRD0%,MASK%)
IF (IBSTA% AND &HC000) <> 0 THEN GOSUB GPIB-
ERROR:
REM
REM Since neither a timeout nor an error
REM occurred, IBWAIT must have returned
REM on SRQ. Next do a serial poll.
REM First unaddress bus devices and send
REM the Serial Poll Enable (SPE) command,
REM then send the DVM's talk address and
REM the GPIB0 listen address &H20 (ASCII
REM space).
REM
CMD$ = "?_" + CHR$(&H18) + "C"
CALL IBCMD (BRD0%,CMD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
REM
REM Now read the status byte. If it is
REM &HC0, the DVM has a valid data to send;
REM otherwise, it has a fault condition
REM to report.
REM
RD$ = SPACE$(1) : CALL IBRD (BRD0%,RD$)
IF IBSTA% < 0 THEN GOSUB GPIB-ERROR:
IF ASC(RD$) <> &HC0 THEN GOSUB DEVICE-ERROR:
REM
REM If more than one device were attached to
REM the bus, it would be necessary to explicitly
REM check the &HC0 bit if the DVM status
REM word to be sure that another device had
REM not been responsible for asserting SRQ.
REM Complete the serial poll by sending
REM the Serial Poll Disable (SPD) message.
REM