Remote  Programming 
EXAMPLE 
PROGRAMS 
/* 
The following application program 
is 
written in 
C 
for the 
IBM 
PC-AT.  The National Instnunen 
Model  AT-GPIB  board provides the interface between  the PC  and the Fluke 884OA 
DMM. 
T): 
prom assumes that the configuration program IBCONF 
has 
been 
run 
to initialize the interfae 
board with the device name IWA assigned to the GPIBO  board. 
This 
program illustrates one possible use of the 
serial 
poll register.  In this 
case 
it 
is 
merely looking for data available.  The function qf  the program 
is 
to 
display on the screen the lowest resistance value measured on the input tertninals 
of  the 
8840A 
using the 2-wire ohms function in autorange,  The range 
and 
function 
commands are programmed using the 
Put 
Instrument ~odguration 
(PO) 
command. 
Microsoft C Version 6.0 on IBM  PC-AT 
/* 
Link 
this 
program 
with 
appropriate mcl%*.obj. 
char rd[S12]; 
int  brd0; 
int 
dmm, 
char spr; 
float r,s; 
char 
rd-string 
/* 
read data buffer 
/* 
interface board number 
/* 
device number 
/* 
serial poll response byte 
brdO 
= 
ibfind( "GPIBO" 
); 
/* 
initialae interface board 
dmm 
= 
ibfind( "IOA" 
); 
/* 
initialiqe 8840A 
ibclr( 
drnm 
); 
/* 
dear 
dhce 
ibwrt( 
dmm, 
"N3001POYl?", 10); 
/* 
write functions to instnunent 
ibrd(dmmjdJ6); 
/* 
get data 
stmcpy(rdstmcpy0;suhg,rd,1 
1); 
r=at~f(rd~suing); 
/* 
convert from stting to floating point 
*/ 
labell 
: 
printf("%sS (2-wire) 
LOWEST 
READING\rW,rd); 
do 
{ 
ibwrt(dmm,"?",l); 
/* 
triggerlthe device 
*/ 
do 
ibrsp(dmm,spr) 
; 
/* 
serial poll the device 
*/ 
while (spr 
& 
0x40 
!= 
0x40); 
/* 
until 
data available 
*/ 
ibrd(dmm,rd,l6); 
/* 
get next data 
*/ 
s=atof(rd); 
/* 
convert to floating point 
*/ 
~rinW\r") 
; 
1 
while (s 
> 
=r) 
; 
/* 
throw away data 
if 
not lowest 
*/ 
r=s; 
goto labell; 
/* 
print 
new low 
*/ 
, 
3-36 
Figure 
3-14. 
Example  Programs: 
Using 
the 
IBM 
~~~fcont) 
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com