EasyManuals Logo

Keysight Technologies X Series Programming Guide

Keysight Technologies X Series
398 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 #277 background imageLoading...
Page #277 background image
Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 277
Creating and Downloading Waveform Files
Programming Examples
char iqbuffer[MAXSAMPLES*4];
// Declare variables which will be used later
bool done;
FILE *infile;
int index, numsamples, i1, i2, ivalue;
// In this example, we’ll assume the data files have
// the I and Q data in binary form as unsigned 16 bit integers.
// This next block reads those binary files. If your
// data is in some other format, then replace this block
// with appropriate code for reading your format.
// First read I values
done = false;
index = 0;
infile = fopen(ifile, “rb”);
if (infile==NULL) perror (“Error opening file to read”);
while(!done)
{
i1 = fgetc(infile); // read the first byte
if(i1==EOF) break;
i2 = fgetc(infile); // read the next byte
if(i2==EOF) break;
ivalue=i1+i2*256; // put the two bytes together
// note that the above format is for a little endian
// processor such as Intel. Reverse the order for
// a big endian processor such as Motorola, HP, or Sun
idata[index++]=ivalue;
if(index==MAXSAMPLES) break;
}
fclose(infile);
// Then read Q values
index = 0;

Table of Contents

Other manuals for Keysight Technologies X Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight Technologies X Series and is the answer not in the manual?

Keysight Technologies X Series Specifications

General IconGeneral
BrandKeysight Technologies
ModelX Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals