
52
Programming the Enhanced Monitor
Chapter 3
Example 3:
Set-up the
RS-232
The following example program demonstrates how to set-up the RS-232 Port on the
Enhanced Monitor. In this setup, the Enhanced Monitor is set to its default values
which are suitable for use with a dumb terminal. The baud rate is changed to 19200
baud.
Note
If you use the Enhanced Monitor RS-232 port (located on the back of the
mainframe) while the mainframe is in the standby mode, you must supply an
ex5Vdc to the +5VEXT connector (located near the RS-232 port). If you
use the RS-232 port while the mainframe is powered on, you do not need to provide
the ex5Vdc.
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
/* Interface address is 9, Enhanced Monitor secondary address is 224*/
/* #define INSTR_ADDR “GPIB0::9::224::INSTR” */
#define INSTR_ADDR “GPIB-VXI0::224::INSTR”
/* 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;
/*Status from each VISA call*/
ViSession viRM;
/*Resource mgr. session */
ViSession en_mon;
/* Enhanced Monitor session */
/* 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__);
/* Reset the Enhanced Monitor */
errStatus = viPrintf(en_mon, “*RST\n”);
CHECKERR(errStatus, __LINE__);
/* Set Serial Port Parametersfor use with dumb terminal */
errStatus = viPrintf(en_mon, “SYST:COMM:SER:PRES:TERM”);
CHECKERR(errStatus, __LINE__);
Содержание E8402A
Страница 8: ...10 Contents ...
Страница 12: ...14 Notes ...
Страница 14: ......
Страница 26: ...28 Getting Started Chapter 1 ...
Страница 42: ...44 Using the Enhanced Monitor Chapter 2 ...
Страница 214: ...216 Servicing Your Mainframe Chapter 5 ...
Страница 226: ...228 HP E8402 E8404A Product Specifications Appendix A ...