Generating An Internal Ac-Coupled Fm Signal Using Visa And C - Agilent Technologies E4438C Programming Manual

Esg vector signal generator
Hide thumbs Also See for E4438C:
Table of Contents

Advertisement

Generating an Internal AC-Coupled FM Signal Using VISA and C

In this example the VISA library is used to generate an ac-coupled internal FM signal at a
carrier frequency of 900 MHz and a power level of −15 dBm. The FM rate will be 5 kHz and
the peak deviation will be 100 kHz. Launch Microsoft Visual C++ 6.0, add the required files,
and enter the following code into your .cpp source file.
The following program example is available on the ESG Documentation CD-ROM as
visaex6.cpp.
//****************************************************************************************
// PROGRAM FILE NAME:visaex6.cpp
//
// PROGRAM DESCRIPION:This example generates an AC-coupled internal FM signal at a 900
// MHz carrier frequency and a power level of -15 dBm. The FM rate is 5 kHz and the peak
// deviation 100 kHz
//
//****************************************************************************************
#include <visa.h>
#include "StdAfx.h"
#include <iostream>
#include <stdlib.h>
#include <conio.h>
void main ()
{
ViSession defaultRM, vi;
ViStatus viStatus = 0;
viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA session
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL, &vi);
if(viStatus){
printf("Example program to set up the signal generator\n");
printf("for an AC-coupled FM signal\n");
printf("\n");
printf("Press any key to continue\n");
getch();
viClear(vi);
viPrintf(vi, "*RST\n");
viPrintf(vi, "FM2:INT:FREQ 5 kHz\n"); // Sets EXT 2 source for FM
viPrintf(vi, "FM2:DEV 100 kHz\n");
Chapter 2
// open session to gpib device at address 19
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
GPIB Programming Examples
// Declares variables of type ViSession
// for instrument communication
// Declares a variable of type ViStatus
// for GPIB verifications
// If problems, then prompt user
// Clears the signal generator
// Resets the signal generator
// Sets FM path 2 coupling to AC
Programming Examples
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Us4146

Table of Contents