Visual C++ Example Program - Agilent Technologies 3488 User Manual

Switch/control system
Table of Contents

Advertisement

Visual C++ Example Program

This example program is written in Visual C++ 6.0 and has been tested
on a PC running WIN95/NT. The example uses the 3488 commands. As
the example is currently written, the program requirements are:
GPIB interface selected and set to the address of 09 from the front-
panel;
Any one of the relay modules installed in Slot 1 of the mainframe;
A GPIB interface card installed in your PC with the VISA library.
#include <stdio.h>
#include <windows.h>
#include "visa.h"
#define INST_ADDR"GPIB0::9::INSTR
void main()
{
ViSession drm;
ViSession vi;
ViStatus status;
int i;
/* Open the default resource manager. */
status = viOpenDefaultRM( &drm );
if ( status < VI_SUCCESS ) {
printf( "VISA ERROR: viOpenDefaultRM()\n");
exit(1);
}
/* Open a session to the 3499A/B/C. */
status = viOpen( drm, INST_ADDR, VI_NULL, VI_NULL, &vi );
if ( status < VI_SUCCESS ) {
printf( "VISA ERROR: viOpen(). Address: %s\n",INST_ADDR);
viClose( drm );
exit(1);
}
/* Set 3499A/B/C to 3488A mode. */
viPrintf( vi, "SYSMODE HP3488A\n" );
Sleep( 4000 );
/* Reset the instrument to a known state. */
viPrintf( vi, "RESET\n" );
Sleep( 4000 );
/* Close channels 100 through 103. */
viPrintf( vi, "CLOSE 100, 101, 102, 103\n");
/* Open channels 100 through 103. */
viPrintf( vi, "OPEN 100, 101, 102, 103\n");
Chapter 7 Application Programs
Visual C++ Example Program
// 3499A/B/C GPIB address.
// Session to default resource manager.
// Session to instrument.
// VISA function status return code.
//Wait 4 seconds.
4
7
139

Advertisement

Table of Contents
loading

This manual is also suitable for:

3499a3499b3499c

Table of Contents