HP (Hewlett-Packard) B Network Router User Manual


 
MEAS.C
/* MEAS.C - This program demonstrates how to take readings using the */
/* digitizer’s MEASure command. In this program, MEASure configures the */
/* digitizer to take 10 readings on the 5V range, using the differential */
/* input port. */
/* Include the following header files */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <cfunc.h> /* This file is from the HP-IB Command Library Disk */
#define ADDR 70905L /* I/O path from PC to the digitizer, via the E1406 */
/* Function Prototypes */
void rst_clr(void);
void ad_meas(void);
void check_error(char *func_tion);
/****************************************************************************/
void main(void) /* run the program */
{
rst_clr(); /* reset the digitizer */
ad_meas(); /* function which configures the digitizer and makes */
/* the measurement */
}
/****************************************************************************/
void ad_meas(void)
{
int i = 0, readings = 10;
float *rdgs;
/* dynamically allocate memory for readings */
rdgs = malloc(10 * sizeof(float));
Continued on Next Page
38 Getting Started Chapter 1