Keithley 2002 User Manual page 328

Hide thumbs Also See for 2002:
Table of Contents

Advertisement

Binary Data Transfer
Microsoft QuickC 2.0
Keithley KPC-488.2 Interface
©1992, Keithley Instruments, Inc.
Description
This program demonstrates the binary data transfer capabil-
ity of the Model 2002. The Model 2002 sends binary read-
ings to the computer using the IEEE754 Single Precision
Data Format.
Required equipment
• Model 2002 Multimeter
• Microsoft QuickC 2.0
Program (bintran.c)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ieee-c.h>
#define K2002 16/* IEEE address of 2002 */
main ()
{
int status, l;
char r[80];
float meas;
float dummy;
initialize (21,0);
setinputEOS (10); setoutputEOS (10,0);
send (K2002,"*IDN?",&status);
enter (r,80,&l,K2002,&status);
printf ("Data received=%s\n",r);
send (K2002,"syst:pres",&status);
send (K2002,"form:elem read",&status);
send (K2002,"form:data sre; bord swap",&status);
while (1) {
send (K2002,"fetch?",&status);
transmit ("MLA TALK 16",&status);
rarray(&meas,5,&l,&status);
printf ("Data received=%e\n",meas);
}
• Any one of the following IEEE-488 interfaces:
Keithley Model KPC-488.2
Keithley Model KPC-488.2AT
Capital Equipment Corporation PC<>488
The program assumes that the Model 2002 is set to address
16.
Linking program with library
After writing and compiling the program, you will have to
link it with the library support files provided with the IEEE-
488 interface. From the DOS prompt, enter the following
command line:
CL myprog.c /link ieee488
The above command line will link your program to the
library. The program can now be run using QuickC.
/* PC controller @ address 2 */
/* Set EOS for input & ouput */
/* Query 2002 for ID string */
/* Get ID string */
/* Print response. */
/* Power Up reset */
/* Readings only */
/* Single precision reals, byte
order swapped. */
/* Loop */
/* Fetch a reading */
/* Put 2002 in talk mode */
/* Get reading */
/* Print reading */
}
Example Programs
G-11

Advertisement

Table of Contents
loading

Table of Contents