Agilent Technologies E1441A user service Arbitrary Waveform Example, Chapter

Models: E1441A

1 206
Download 206 pages 30.53 Kb
Page 61
Image 61
Arbitrary Waveform Example

err=viPrintf(funcgen, "SOURce:AM:STATe ON\n"); /* enable AM mode */ if(err != VI_SUCCESS) err_handler(funcgen, err);

/* save this configuration in E1441A memory location 1, use a */ err=viPrintf(funcgen, "*SAV 1\n");

if(err != VI_SUCCESS) err_handler(funcgen, err);

/* Check for system errors. */ err=viQueryf(funcgen, "syst:err?\n", "%t", buf); if(err != VI_SUCCESS) err_handler(funcgen, err); printf("System error response = %s\n\n", buf);

/* close the device session */ viClose(funcgen);

} /* end of main */

/*** Error handling function ***/

void err_handler(ViSession funcgen, ViStatus err)

{

char buf[1024] = {0}; viStatusDesc(funcgen, err, buf); printf("ERROR = %s\n", buf); return;

}

Arbitrary Waveform Example

/* 1441_arb.C - This program sets up the E1441A

to output an AM waveform. */

/*

The program also stores the configuration in

memory for subsequent

*/

/*

recall.

*/

 

#include <stdio.h> #include <visa.h> #include <math.h>

/*** FUNCTION PROTOTYPE ***/

void err_handler (ViSession vi, ViStatus x);

#define DEVICE_ADDRESS "GPIB-VXI0::80::INSTR"

void main(void)

{

char buf[512] = {0};

ViStatus err;

ViSession defaultRM, funcgen;

/* program variables */ ViInt16 i;

ViReal64 j;

ViReal64 sinxwave[4096];

ViReal64 pi;

ViReal64 max_v;

ViInt16 idx;

Chapter 2

Agilent E1441A Application Information 61

Page 61
Image 61
Agilent Technologies user service Arbitrary Waveform Example, Chapter, Agilent E1441A Application Information