Remote
Programming
EXAMPLE
PROGRAMS
,
The following application program
is
written
in
QBASIC for the IBM
PC,
PC-XT or
Y
PGAT. The National
Instruments
Model
GPIB-PUIA bohd provides the interface
,
between
the PC and the Fluke 8840A
DMM.
The program assumes that the configuration
Y
program IBCONF
has
been
run
to initialize the interfacd
board
with
the device
3
name 18840A assigned to the GPIBO board.
Y
This
program illustrates one possible use of
the
serial
p@ll register. In
this
Y
case it
is
merely looking for data available. The fundoh of the program
is
to
Y
display on the screen the lowest resistance value
measuked
on the input terminals
Y
of the WA using the 2-wire ohms function
in
autoraqge. The range and function
Y
commands are programmed using the
Put
Instrument Cbnfiguration
(PO)
command.
I
9
Miaosoft QuickBasic
V
4.5
on IBM PC, PC-XT or PGAT
'$INCLUDE: 'qbib45.dcl'
kidname$
=
"GPIBO"
'Board hame
is
GPIBO
CALL
IBFIND(bdnarne$,
BD%)
Initialize the Interface
Board
devname$
=
"18840An
'Device name
is
I8840A
CALL
IBFIND(devname$, dm%)
Initia&e the device
CALL
IBCLR{dm%) 'Clear the device
WRT$
=
W~OOIPO
n
?*
CALL
IBWRT(dvm%,
WRWRT$)
Write functions to the instrument
RD$
=
SPACE$(18)
CALL
IBRD(dvm%,
RD$)
'Get
first reading
r
=
VALO$)
labell:
PRINT
LElT$(RD$,
16);
"S
(&WIRE)
LOWEST READING"
DO
'Execute the statements up to the loop
'statemant
until
new low
is
found
WRT$
=
"?"
CALL
IBWRT(dvm%,
WRT$)
Trigger the device
SPR%
=
0
DO
UNTIL
SPR%
AND
&H40
=
&H40
CALL
IBRSP(dvm%, SPR%)
Serial pll the device
until
data available
LOOP
RD$
=
SPACE$(18)
CALL
IBRD(dvm%,
RD$)
'Get next data
s
=
VAL(RD$)
LOOP
WHILE
s
>
=
r
Throw away data
if
not lowest
r=s
Update lowest reading
GOT0 labell 'Print new low
END
3-32
@
Figure
3-14.
Example
Programs:
Using
the
3BM
PC
(cont)
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com