beautypg.com

Agilent Technologies N5183A MXG User Manual

Page 248

background image

238

Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide

Creating and Downloading Waveform Files
Programming Examples

Creating and Downloading I/Q Data—Big and Little Endian Order

On the documentation CD, this programming example’s name is “CreateDwnLd_Data_c++.txt.”

This C++ programming example (compiled using Microsoft Visual C++ 6.0) performs the following
functions:

error checking

data creation

data scaling

text file creation for viewing and debugging data

byte swapping and interleaving for little endian order data

interleaving for big endian order data

data saving to an array (data block)

data block download to the signal generator

// This C++ program is an example of creating and scaling

// I and Q data, and then downloading the data into the

// signal generator as an interleaved I/Q file.

// This example uses a sine and cosine wave as the I/Q

// data.

//

// Include the standard headers for SICL programming

#include

#include

#include

#include

#include

// Choose a GPIB, LAN, or RS-232 connection

char* instOpenString =”lan[galqaDhcp1]”;

//char* instOpenString =”gpib0,19”;

// Pick some maximum number of samples, based on the

// amount of memory in your computer and the signal generator.

const int NUMSAMPLES=500;

int main(int argc, char* argv[])

{

// Create a text file to view the waveform

// prior to downloading it to the signal generator.

// This verifies that the data looks correct.

char *ofile = “c:\\temp\\iq.txt”;

This manual is related to the following products: