C Version
/* E1411_RS.CPP - This program resets the multimeter. */
#include <sicl.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define PASS_FAIL (iwpeek((unsigned short *)(bas 0X04)) & 0x04)
/* Function prototypes */
void reset_mm(char *base_addr);
void main(void)
{
char *base_addr;
/* 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 reset the multimeter */
reset_mm(base_addr);
/* close session */
iclose(e1411b);
}
/
******************************************************
/
void reset_mm(char *base_addr)
{
/* 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 *)(bas 0x04),2); /* disable ’SYSFAIL’ */
iwpoke((unsigned short *)(bas 0x04),3);
iwpoke((unsigned short *)(bas 0x04),3); /* bit must be set for 2 us */
iwpoke((unsigned short *)(bas 0x04),3);
iwpoke((unsigned short *)(bas 0x04),2);/* turn off reset */
while (!PASS_FAIL); /* wait for the reset to complete */
iwpoke((unsigned short *)(bas 0x04),0);/* enable ’SYSFAIL’ */
}
222 HP E1326B/E1411B Multimeter Register-Based Programming
Appendix C
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com