CONF.C

/* CONF.C - This program demonstrates how to use the CONFigure command and */ /* low-level digitizer commands to configure the digitizer. INITialize and */

/* FETCh? are used to trigger the digitizer and retrieve the readings from */ /* digitizer memory. */

/* 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 the PC to the digitizer */

/* Function Prototypes */

void rst_clr(void); void ad_conf(void); void ad_fetch(void);

void check_error(char *func_tion);

/****************************************************************************/

void main(void) /* run the program */

{

rst_clr();

/* reset the digitizer */

ad_conf();

/* send commands which configure the digitizer */

ad_fetch();

/* send command which retrieves the digitizer readings */

}

/****************************************************************************/ void ad_conf(void)

{

int length = 0, loop = 0;

/* use the "set_commands" array to configure digitizer channel 1 */

char static *set_commands[] =

 

{"CONF1:ARR:VOLT (20),1,(@1)",

/* set 20 readings, 1V range, */

 

/* S/E input port 1 */

"SENS1:SWE:OFFS:POIN -10",

/* set 10 pre-arm readings */

"INIT"};

/* place digitizer in */

 

/* wait-for-arm state */

Continued on Next Page

Chapter 1

Getting Started 41

Page 41
Image 41
HP E1429A manual Conf.C