Agilent Technologies E1441A Oven User Manual


 
Agilent E1441A Application Information 61
Chapter 2
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;