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

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

{

rst_clr(ADDR);

/* reset the digitizer */

rst_clr(ADDR_MEM);

/* reset the memory card */

configure();

/* configure the digitizer and the memory card */

initiate();

/* initiate the digitizer and memory card; */

 

/* retrieve the readings from the memory card */

}

/****************************************************************************/ void configure(void)

{

int length = 0, loop = 0;

/* use the "digitizer" array to configure the digitizer for readings on */ /* each channel’s (HI) differential input */

char static *digitizer[] =

 

 

{"CONF1:ARR:VOLT (10),5,(@3)",

/* set 10 readings, 5V range, */

 

 

/* channel 1 input port 3 */

"CONF2:ARR:VOLT (10),5,(@4)",

/* configure channel 2, port 4 */

"VINS:LBUS:RES",

 

/* reset the Local bus chip */

"VINS:LBUS:MODE GEN",

 

/* set Local bus mode to GENerate */

"VINS:LBUS:FEED ’CONV:BOTH’"};

/* set Local bus feed (direct from A/D)

/* use the "memory" array to configure the memory card */

char static *memory[] =

 

 

{"FORM:DATA PACK",

/* set packed data format */

"TRAC:DEL:ALL",

/* delete all readings on memory card */

"TRAC:DEF SET2, 40",

/* store readings (40 bytes) in "SET2" */

"VINS:LBUS:RES",

/* reset the Local bus chip */

"VINS:LBUS:MODE CONS",

/* set Local bus mode to consume */

"STAT:OPC:INIT OFF"};

/* execute *OPC? after INIT is parsed */

/* Execute each command in "digitizer" */

length = (sizeof(digitizer) / sizeof(char*));

for (loop = 0; loop < length; loop++)

{

IOOUTPUTS(ADDR, digitizer[loop], strlen(digitizer[loop]));

}

/* Execute each command in "memory" */

Continued on Next Page

84 Using the Digitizer

Chapter 2

Page 84
Image 84
HP E1429A manual Vinslbusres, Vinslbusmode GEN, Vinslbusfeed ’CONVBOTH’, Formdata Pack, Tracdelall, Vinslbusmode Cons