HP (Hewlett-Packard) B Network Router User Manual


 
/* Execute each command in "memory" */
length = (sizeof(memory) / sizeof(char*));
for (loop = 0; loop < length; loop++)
{
IOOUTPUTS(ADDR_MEM, memory[loop], strlen(memory[loop]));
}
/* check for digitizer and memory card configuration errors */
check_error("digitizer1", ADDR_G);
check_error("digitizer2", ADDR_A);
check_error("memory", ADDR_MEM);
}
/****************************************************************************/
void initiate(void)
{
int i = 0, readings = 20, swap = 0, bytes = 0, length = 1, *rdgs;
float rdy;
char lf_remove[1];
/* dynamically allocate memory for readings */
rdgs = malloc(20 * sizeof(float)); /* allocate computer memory for reading storage */
swap = sizeof(int); /* each reading in memory is two bytes */
bytes = 20 * swap; /* read 40 bytes */
IOOUTPUTS(ADDR_MEM, "INIT", 4); /* initiate the memory card */
IOOUTPUTS(ADDR_MEM, "*OPC?", 5); /* wait for INIT to parse before continuing */
IOENTER(ADDR_MEM, &rdy); /* enter *OPC? response from memory card */
IOOUTPUTS(ADDR_A, "INIT", 4); /* initiate the appender digitizer */
IOOUTPUTS(ADDR_G, "INIT", 4); /* initiate the generator digitizer */
IOOUTPUTS(ADDR_G, "*OPC?", 5); /* allow the readings to complete before */
/* retrieving them from the memory card */
IOENTER(ADDR_G, &rdy); /* enter *OPC? response from the digitizer */
IOOUTPUTS(ADDR_MEM, "TRAC:DATA? SET1", 15); /* retrieve readings from memory
card */
IOENTERAB(ADDR_MEM, rdgs, &bytes, swap); /* enter readings and remove block header
*/
Continued on Next Page
90 Usin
g
the Di
g
itizer Chapter 2