HP (Hewlett-Packard) B Network Router User Manual


 
/* copy the shift register bits to the shift register latch by */
/* writing a value of 4 to the strobe register */
sprintf(strobe_write,"DIAG:POKE %ld, %d, %d", base_addr+0x0B,8,4);
IOOUTPUTS(CMD_MOD, strobe_write, strlen(strobe_write));
}
/****************************************************************************/
void set_trig_source(long base_addr)
{
/* This function sets the digitizer trigger source to the reference period / n. */
/* The reference source is the digitizer’s internal 20 MHz oscillator which */
/* was set by the CONFigure command. */
char command[80];
int bit_reg = 0;
float bit_pat = 0;
/* read trigger source register */
sprintf(command, "DIAG:PEEK? %ld, %d", base_addr+0x4D,8);
IOOUTPUTS(CMD_MOD, command, strlen(command));
IOENTER(CMD_MOD, &bit_pat);
/* retain register settings, set trigger source to reference period / n */
bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 : -.5));
bit_reg = (bit_reg & 0xE3) | 0x10;
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x4D,8,bit_reg);
IOOUTPUTS(CMD_MOD, command, strlen(command));
}
/****************************************************************************/
void initialize(long base_addr)
{
/* This function initializes digitizer memory. This includes initializing the */
/* memory control register, specifying the data storage locations in memory, */
/* and enabling data to be written to memory. Note that the registers must be */
/* read and written to in the sequence shown. */
char command[80];
int bit_reg = 0;
float bit_pat = 0;
Continued on Next Page
394 Register Programming Appendix C