HP (Hewlett-Packard) B Network Router User Manual


 
/* Function prototypes */
long get_base_addr(void);
void rst_clr(void);
void ad_conf(void);
void mem_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 */
ad_conf(); /* function call to configure the digitizer */
mem_read(base_addr); /* function call which reads the data register */
}
/****************************************************************************/
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 (100),1,(@1)", /* set 100 readings, on S/E port 1 */
"TRIG:STAR:SOUR VME", /* trigger source is reads of data register */
"VINS:CONF:VME:MODE GEN", /* enable data transfer over the VME bus */
"VINS:CONF:VME:FEED ’CONV:CHAN1’", /* set real time data transfer */
"INIT"}; /* place the digitizer in the wait-for-arm state */
length = (sizeof(set_commands) / sizeof(char*));
/* Execute each command using a loop */
for (loop = 0; loop < length; loop++)
{
IOOUTPUTS(ADDR, set_commands[loop], strlen(set_commands[loop]));
}
/* function call to check for digitizer configuration errors */
check_error("ad_conf");
}
Continued on Next Page
64 Usin
g
the Di
g
itizer Chapter 2