/* turn channel 1 20 dB post attenuator on */

/* read bit 35 by reading the A/D status register */

case 35:IOOUTPUTS(CMD_MOD, stat_read, strlen(stat_read)); IOENTER(CMD_MOD, &bit);

/* set bit 35 to ’0’ by writing to the A/D serial register */ sprintf(stat_write,"DIAG:POKE %ld, %d, %d", base_addr+0x05,8,0); IOOUTPUTS(CMD_MOD, stat_write, strlen(stat_write));

break;

/* turn channel 1 20 dB input attenuator off */

/* read bit 34 by reading the A/D status register */

case 34:IOOUTPUTS(CMD_MOD, stat_read, strlen(stat_read)); IOENTER(CMD_MOD, &bit);

/* set bit 34 to ’1’ by writing to the A/D serial register */ sprintf(stat_write,"DIAG:POKE %ld, %d, %d", base_addr+0x05,8,1); IOOUTPUTS(CMD_MOD, stat_write, strlen(stat_write));

break;

/* route input signal to channel 1 attenuators */

/* read bit 10 by reading the A/D status register */

case 10:IOOUTPUTS(CMD_MOD, stat_read, strlen(stat_read)); IOENTER(CMD_MOD, &bit);

/* set bit 10 to ’1’ by writing to the A/D serial register */ sprintf(stat_write,"DIAG:POKE %ld, %d, %d", base_addr+0x05,8,1); IOOUTPUTS(CMD_MOD, stat_write, strlen(stat_write));

break;

/* read and shift all other shift register bits to restore each bit */ /* to its original position */

default:IOOUTPUTS(CMD_MOD, stat_read, strlen(stat_read)); IOENTER(CMD_MOD, &bit);

bit_set = (int)(bit + ((bit >= 0) ? .5 : -.5));

sprintf(stat_write,"DIAG:POKE %ld, %d, %d", base_addr+0x05,8,bit_set); IOOUTPUTS(CMD_MOD, stat_write, strlen(stat_write));

break;

}

}

Continued on Next Page

Appendix C

Register Programming 393

Page 393
Image 393
HP E1429A manual On Next