User`s manual

dmm_2byte = (dmm_2byte >> 1);
/* get range code from rng variable, get range from */
/* the appropriate range table */
if (func == 2)
range = ohm_range[rng];
else
range = volt_range[rng]; /* voltage ranges */
/* compute and print reading */
reading = (range * dmm_2byte) / 0x3FFF;
printf("\n%.5E", reading);
}
}
}
}
/******************************************************/
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);
/* bit must be set for 2 us */
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’ */
}
Appendix C HP E1326B/E1411B Multimeter Register-Based Programming 245