User`s manual

/******************************************************/
void check_for_error(char *base_addr_dmm)
{
unsigned short error_code; /* variable for error code from the */
/* query response register */
/* write ’send error’ to command register, wait for */
/* Qryrdy bit = 1 */
iwpoke((unsigned short *)(base_addr_dmm + 0x08),15);
while (!QRYRDY);
error_code = iwpeek((unsigned short *)(base_addr_dmm + 0x08));
printf("Error code = %x", (error_code & 0xFF));
exit(EXIT_FAILURE); /* exit program */
}
/*******************************************************/
void reset_mm(char *base_addr_dmm)
{
/* This function resets the multimeter by disabling the Control Register */
/* ’SYSFAIL’ bit (bit 1), and then by writing a ’1’ to bit 0 and then by */
/* writing a ’0’ to bit 0. After the reset, the ’SYSFAIL’ bit is re-enabled. */
iwpoke((unsigned short *)(base_addr_dmm + 0x04),2);/*disable ’SYSFAIL’ */
iwpoke((unsigned short *)(base_addr_dmm + 0x04),3);
iwpoke((unsigned short *)(base_addr_dmm + 0x04),3);/*set bit for 2us*/
iwpoke((unsigned short *)(base_addr_dmm + 0x04),3);
iwpoke((unsigned short *)(base_addr_dmm + 0x04),2);/* turn off reset */
while (!PASS_FAIL); /* wait for the reset to complete */
iwpoke((unsigned short *)(base_addr_dmm + 0x04),0);/* enable ’SYSFAIL’ */
}
/******************************************************/
void reset_fet(char *base_addr_fet)
{
/* This function resets the FET multiplexer by writing a ’1’ to Control */
/* register bit 0, waiting 100 ms, and then writing a ’0’ to bit 0. */
iwpoke((unsigned short *)(base_addr_fet + 0x04),1);/* set bit 0 to 1 */
delay (100); /* wait 100 ms (Borland C++ function) */
iwpoke((unsigned short *)(base_addr_fet + 0x04),0);/* set bit 0 to 0 */
}
Appendix C HP E1326B/E1411B Multimeter Register-Based Programming 261