C Version
/* E1411_M.CPP - This program takes measurements on the front */
/* terminals of the E1411B multimeter. */
#include <sicl.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
/* define macros to monitor status register conditions */
#define READY (iwpeek((unsigned short *)(base_ad 0x04)) & 0x01)
#define DONE ((iwpeek((unsigned short *)(base_ad 0x04)) & 0x81) ==
0x81)
#define DATARDY ((iwpeek((unsigned short *)(base_ad 0x04)) & 0x91)
== 0x91)
#define QRYRDY ((iwpeek((unsigned short *)(base_ad 0x04)) & 0x83)
== 0x83)
#define NOERR ((iwpeek((unsigned short *)(base_ad 0x04)) & 0xC1)
== 0xC1)
#define PASS_FAIL (iwpeek((unsigned short *)(base_ad 0X04)) & 0x04
/* Function prototypes */
void configure_dmm(char *base_addr_dmm, int command, int parameter);
void set_sample_period(char *base_addr_dmm, int command, unsigned short
parameter);
void set_dmm_counts(char *base_addr_dmm, int command, long parameter);
void no_dmm_parameters(char *base_addr_dmm, int command);
void trigger_dmm(char *base_addr_dmm);
void check_for_error(char *base_addr_dmm);
void reset_mm(char *base_addr_dmm);
int aper, rng, func; /* global variables to contain the multimeter */
/* aperture time, range, and function; which are */
/* used to calculate the reading */
void main(void)
{
char *base_addr_dmm;
/* pointer to multimeter base address */
clrscr();
/* clear the user screen */
/* create and open the device session */
INST e1411b;
e1411b = iopen("vxi,24");
Continued on Next Page
Appendix C
HP E1326B/E1411B Multimeter Register-Based Programming 239
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com