C Version
/* E1411_EC.CPP - This program generates an error and then reads the */
/* error code from the Query Response Register. */
#include <sicl.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define READY (iwpeek((unsigned short *)(bas 0x04)) & 0x01)
#define DONE ((iwpeek((unsigned short *)(bas 0x04)) & 0x81) == 0x81)
#define QRYRDY ((iwpeek((unsigned short *)(bas 0x04)) & 0x83) == 0x83)
#define NOERR ((iwpeek((unsigned short *)(bas 0x04)) & 0xC1) == 0xC1)
/* Function prototypes */
void cause_error(char *base_addr);
void check_for_error(char *base_addr);
void main(void)
{
char *base_addr;
/* clear the user screen */
clrscr();
/* create and open a device session */
INST e1411b;
e1411b = iopen("vxi,24");
/* map the E1411B registers into user memory space */
base_addr = imap(e1411b, I_MAP_VXIDEV, 0, 1, NULL);
/* function call to cause a multimeter error */
cause_error(base_addr);
/* close session */
iclose(e1411b);
}
/
*******************************************************
/
void cause_error(char *base_addr)
{
Continued on Next Page
232 HP E1326B/E1411B Multimeter Register-Based Programming
Appendix C
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com