Agilent Technologies 8163A Programming Manual page 151

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

Advertisement

How to Log Results
#include <stdlib.h>
#include <string.h>
#include <visa.h>
#define MAX_LOG_VALUES 4000 /* max number of values the instrument is capable to
log */
#define HEADER_SIZE 7 /* includes 6 bytes header and 1 CR */
/* function prototypes for this examples/*
/* function for a simple error handling explained in example 1 */
void
/* initialize the visa interface */
ViStatus InitVisa ( ViSession *iHandle);
/*globals*/
static unsigned char logBuffer[MAX_LOG_VALUES * sizeof(ViReal64) + HEADER_SIZE];
/*array for the float results */
static ViReal32 logResults[MAX_LOG_VALUES];
void main (void)
{
ViStatus
ViSession vi;
ViChar
ViChar
ViInt32 slot;
ViInt32 chan;
ViInt32 i;
ViInt32
ViReal64
ViPChar
ViInt32 noOfDigits;
ViUInt32 retCnt;
errStatus = InitVisa(&vi);
if(errStatus < VI_SUCCESS)
{
exit(errStatus);
}
/* clear instrument error queue */
errStatus = viPrintf(vi,"*CLS\n");
checkError(vi,errStatus);
Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel
System, Third Edition
checkError(ViStatus session, ViStatus err_status );
errStatus;
/* returned error code from visa call */
/* current session handle */
replyBuf[256]; /* buffer holding answers of the instrument */
c;
/* used in the keyboard wait loop */
/* slot number where the power meter is plugged */
/* channel to be logged */
/* loop counter */
noOfValues;
/* number of values to be logged*/
averagingTime; /* aveaging time used in a logging cycle */
replySubStr; /* pointer to a substring of the instruments reply */
/*number of digits, specifing the amount data
to be read */
/* returns the number of bytes read calling viRead */
VISA Programming Examples
151

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents