HP E8402A User And Service Manual page 48

Vxi c-size mainframe
Table of Contents

Advertisement

Example 2:
Setting up the
Mainframe
50 Programming the Enhanced Monitor
The following example program demonstrates how to customize the mainframe's
Enhanced Monitor features. Specifically, it enables the status subsystem, sets
temperature limits for a specific slot in the mainframe and verifies the limit. To
simulate a limit warning, you can set the limit to a value lower than ambient
temperature.
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
/* Interface address is 9, Enhanced Monitor default secondary address is 224 */
/* #define INSTR_ADDR "GPIB0::9::224::INSTR" */
#define INSTR_ADDR "GPIB-VXI0::224::INSTR"
/* Enable STAT:OPER bits for Calibrating, Measuring, History Queue Full */
#define OPER_ENAB
/* Enable STAT:QUES bits for Voltage Summary, Current Summary, Power,
Temperature summary, Calibration, Blower summary, UMCounter, Unexpected
parameter */
#define QUES_ENAB
/* Set absolute temperature limit TEMP_LIM (45
#define LIM_SLOT
#define TEMP_LIM
/* a simple VISA error-handling macro. This version prints the line number from which
it was called and exits if it gets an error */
#define CHECKERR(errStatus, line) if (errStatus < VI_SUCCESS) { \
printf("Line %d: error %x returned from visa. Aborting\n", \
line, errStatus); \
exit (errStatus); \
}
int main()
{
ViStatus errStatus;
ViSession viRM;
ViSession en_mon;
ViUInt16 echoed_limit;
/* Open the default resource manager */
errStatus = viOpenDefaultRM(&viRM);
CHECKERR(errStatus, __LINE__);
/* Open the Enhanced Monitor instrument session */
errStatus = viOpen(viRM, INSTR_ADDR, VI_NULL, VI_NULL, &en_mon);
CHECKERR(errStatus, __LINE__);
(ViUInt16)0x0411
(ViUInt16)0x471B
°
C) for slot LIM_SLOT (slot 6)*/
"OUT6"
(ViInt16)45
/* Status from each VISA call */
/* Resource mgr. session */
/* Enhanced Monitor session */
/* For verification of programmed temp
limit */
Chapter 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

E8404a

Table of Contents