Remote 
Programrjring 
EXAMPLE 
PrnRAMS 
The following application program 
is 
written 
in 
QBASC for the 
IBM 
PC,  PC-XT  or 
PC-AT.  The National Instruments Model GPIB-PUIA board provides the interface 
between the PC  and the Fluke 8840A 
DMM 
The program assumes that the configuration 
program IBCONF has been 
run 
to initialize the interface board 
with 
the device 
name I8840A assigned to the GPIBO  board. 
This program 
illustrates a method of  recording any errors produced by the 8840A 
selftest function.  It should be noted that: 
1. 
If  more than one digital error occm, only the last one 
wiu 
be reported. 
2. 
The response to a Get Instrument Config.  (GO)  command during selftest 
is 
"W. 
3.  The response to a Get Error Status (G7)  command with no ermn present 
is 
"1000". 
Microsoft QuickBasic 
V 
4.5  on IBM  PC,  PC-XT  or PC-AT 
'$INCLUDE:  'qbib45.dcl' 
BDNAh4E$ 
= 
"GPIBO"  'Board  name is  GPIBO 
CALL 
IBFIND(BDNAME$, BD%) 
'Initialize the interface board 
devname$ 
= 
"IWOA" 
'Device name 
is 
18840A 
CALL 
IBFIND(devname$, dm%) 
'Initialize the device 
PRINT  "MONITORING 
SELFTEST" 
WRT$ 
= 
"20" 
CALL 
IBWRT(dm%, WRT$) 
DO 
'Start selftest 
WRT$ 
= 
"G7" 
CALL 
IBWRT(dvm%, WRT$) 
RD$ 
= 
SPACE$(18) 
CALL 
IBRD(dvm%, 
RJX) 
'Get  error status 
errcode$ 
= 
LEFT$(RD$,  4) 
IF  (errcode$ 
< 
> 
"1000") 
THEN 
'Check  for errors 
WRT$="XO" 
'Clear  error register 
CALL 
IBWRT(dvm%, 
WRT$I 
PRINT  "Error 
"; 
RIGHT$(errcode$, 
3); 
" 
occurred" 
END 
IF 
CALL 
IBWRT(dvm%, "GO") 
st$ 
= 
SPACE$(16) 
CALL 
IBRD(dvm%, st$) 
stat$ 
= 
LEF'T$(st$, 
1) 
LOOP  WHILE  stat$ 
= 
"9" 
WRT$ 
= 
"G7" 
'Get  instrument configuration 
'Loop while selftest still active 
CALL 
IBWRT(dvm%, WRT$) 
RD$ 
= 
SPAGE$(18) 
CALL 
IBRD(dvrn%, 
RD$) 
'Get  error status 
errcode$ 
= 
LEFT$(RD$, 
4) 
IF  (errcode$ 
< 
> 
"1000") THEN 
'Check for em 
PRINT  "Error"; RIGHT$(errcode$, 3); 
" 
occurred" 
END 
IF 
PRINT 
PRINT  "Selftest Complete" 
END 
I 
@ 
Figure 
3-14. 
Example  Programs: 
Using 
the 
IBM 
PC 
(cont) 
3-33 
-- 
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com