54 Keysight E8402A, E8404A C-Size Mainframes User and Service GuideProgramming the Enhanced Monitor Programming ExamplesExample 3: Set-up the RS-232The following example program demonstrates how to set-up the RS-232 Port onthe Enhanced Monitor. In this setup, the Enhanced Monitor is set to its defaultvalues which are suitable for use with a dumb terminal. The baud rate is changedto 19200 baud.#include #include #include /* 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 numberfrom whichit 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);If you use the Enhanced Monitor RS-232 port (located on the backof the mainframe) while the mainframe is in the standby mode,you must supply an external +5Vdc to the +5VEXT connector(located near the RS-232 port). If you use the RS-232 port whilethe mainframe is powered on, you do not need to provide theexternal +5Vdc.