/****************************************************************************/ void memory_retrieve(long base_addr)

{

/* This function sets the address locations of the readings in digitizer memory, */ /* and enables the readings to be retrieved using the digitizer’s data register. */

char command[80]; int bit_reg = 0; float bit_pat = 0;

/* using the traffic register set the pulse register as the high-speed */ /* clock source, the A/D is still the data source */

sprintf(command, "DIAG:PEEK? %ld, %d", base_addr+0x02,8); IOOUTPUTS(CMD_MOD, command, strlen(command)); IOENTER(CMD_MOD, &bit_pat);

/* retain register settings, set pulse register as the high-speed */ /* clock source */

bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 : -.5)); bit_reg = (bit_reg & 0xF3);

sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x02,8,bit_reg); IOOUTPUTS(CMD_MOD, command, strlen(command));

/* send a clock pulse to the internal high-speed bus to place the last */ /* A/D reading into memory */

sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x08,8,0); IOOUTPUTS(CMD_MOD, command, strlen(command));

/* initialize the memory control register by setting bits 2 - 0 to ’0 0 0’ */

sprintf(command, "DIAG:PEEK? %ld, %d", base_addr+0x21,8); IOOUTPUTS(CMD_MOD, command, strlen(command)); IOENTER(CMD_MOD, &bit_pat);

/* retain register settings, set memory control register bits 2 - 0 */ /* to ’0’ */

bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 : -.5)); bit_reg = (bit_reg & 0xF8);

sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x21,8,bit_reg); IOOUTPUTS(CMD_MOD, command, strlen(command));

Continued on Next Page

Appendix C

Register Programming 399

Page 399
Image 399
HP E1429A manual On Next