EasyManuals Logo
Home>Agilent Technologies>Portable Generator>N5182A

Agilent Technologies N5182A Programming Guide

Agilent Technologies N5182A
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #246 background imageLoading...
Page #246 background image
236 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
Creating and Storing I/Q Data—Little Endian Order
On the documentation CD, this programming example’s name is “CreateStore_Data_c++.txt.”
This C++ programming example (compiled using Metrowerks CodeWarrior 3.0) performs the following
functions:
•error checking
data creation
byte swapping and interleaving for little endian order data
binary data file storing to a PC or workstation
After creating the binary file, you can use FTP, one of the download utilities, or one of the C++
download programming examples to download the file to the signal generator.
#include <iostream>
#include <fstream>
#include <math.h>
#include <stdlib.h>
using namespace std;
int main ( void )
{
ofstream out_stream; // write the I/Q data to a file
const unsigned int SAMPLES =200; // number of sample pairs in the waveform
const short AMPLITUDE = 32000; // amplitude between 0 and full scale dac value
const double two_pi = 6.2831853;
//allocate buffer for waveform
short* iqData = new short[2*SAMPLES];// need two bytes for each integer
if (!iqData)
{
cout << "Could not allocate data buffer." << endl;
return 1;
}
out_stream.open("IQ_data");// create a data file
if (out_stream.fail())
{
cout << "Input file opening failed" << endl;
exit(1);
}
//generate the sample data for I and Q. The I channel will have a sine
//wave and the Q channel will a cosine wave.

Table of Contents

Other manuals for Agilent Technologies N5182A

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies N5182A and is the answer not in the manual?

Agilent Technologies N5182A Specifications

General IconGeneral
BrandAgilent Technologies
ModelN5182A
CategoryPortable Generator
LanguageEnglish

Related product manuals