HP 8163A Series Programming Manual page 135

Lightwave multimeter, lightwave measurement system & lightwave multichannel system, mainframes
Hide thumbs Also See for 8163A Series:
Table of Contents

Advertisement

How to Co-ordinate Two Modules
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <visa.h>
/* function prototypes for this examples */
/* function for a simple error handling explained in example 1 */
void checkError(ViSession session, ViStatus err_status );
void main (void)
{
ViStatus
ViSession
ViSession
ViChar
ViChar
ViInt32 i;
ViInt32 cmdDone;
/* First get initialized the visa library (see example 1) */
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}
/* Open session to HPIB device at address 20; */
errStatus = viOpen (defaultRM, "GPIB::20::INSTR", VI_NULL,VI_NULL,&vi);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open instrument\n");
exit(errStatus);
}
/* set timeout to 20 sec; this should work for all commands except zeroing */
errStatus = viSetAttribute(vi,VI_ATTR_TMO_VALUE,20000);
if (errStatus < VI_SUCCESS) checkError(vi,errStatus);
/* clear error queue */
HP 8163A Lightwave Multimeter, HP 8164A Lightwave Measurement System,
& HP 8166A Lightwave Multichannel System User's Guide, E1299
Install a Power Sensor in Slot 1 and a Laser Source in Slot 2 and connect the
Laser Source output to the Power Sensor input, before executing this example.
errStatus;
/* returned error code from visa call */
defaultRM;
/* default visa resource manager variable */
vi;
/* current session handle */
replyBuf[256]; /* buffer holding answers of the instrument */
c;
/* used in the keyboard wait loop */
/* loop counter */
/* return value for OPC command */
Programming Examples
135

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a series8166a series

Table of Contents