HP (Hewlett-Packard) B Network Router User Manual


 
REG_PROG.C
/* REG_PROG.C - This program configures the digitizer using register reads */
/* and writes. The program sets an initial digitizer configuration using */
/* the CONFigure command and takes a set of readings using the READ? */
/* command. Register reads and writes are then used to change the measurement */
/* range, change the trigger source, change the post-arm reading count, re-initiate */
/* the digitizer, and retrieve the readings. */
/* 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 */
#define ADDR 70905L /* I/O path between the digitizer and PC */
#define CMD_MOD 70900L /* I/O path between the PC and the Command Module */
/* Function prototypes */
long get_base_addr(void);
void rst_clr(void);
void conf_read(void);
void input_config(long base_addr);
void set_trig_source(long base_addr);
void initialize(long base_addr);
void initiate(long base_addr);
void memory_retrieve(long base_addr);
void data_read(long base_addr);
void check_error(char *function);
/****************************************************************************/
void main(void)
{
long base_addr; /* variable for digitizer A24 base address */
rst_clr(); /* reset and clear the digitizer */
base_addr = get_base_addr(); /* function call to calculate and */
/* return digitizer A24 base address */
conf_read(); /* function call to take first set of readings */
input_config(base_addr); /* function call to set the 1V measurement range */
set_trig_source(base_addr); /* function call which sets the trigger source */
initialize(base_addr);
Continued on Next Page
390 Register Programming Appendix C