EasyManuals Logo

Keysight Technologies N5166B CXG Programming Guide

Keysight Technologies N5166B CXG
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 #258 background imageLoading...
Page #258 background image
258 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
FILE *stream = NULL;
stream = fopen(filename, “w+b”);// Open the file
if (stream==NULL) perror (“Cannot Open File”);
int numwritten = fwrite( (void *)waveform, sizeof( short ),
points*2, stream );
fclose(stream);// Close the file
// 3.) Load the internal Arb format file *********************
// This process is just the reverse of saving the waveform
// Read in waveform as unsigned short integers.
// Swap the bytes as necessary
// Normalize between +-1
// De-interleave the I/Q Data
// Open the file and load the internal format data
stream = fopen(filename, “r+b”);// Open the file
if (stream==NULL) perror (“Cannot Open File”);
int numread = fread( (void *)waveform, sizeof( short ),
points*2, stream );
fclose(stream);// Close the file
// If on a PC swap the bytes back to Little Endian
if( strcmp(computer,”PCWIN”) == 0 )
{
pChar = (char *)&waveform[0]; // Character pointer to short
int data
for( i=0; i<2*points; i++ )
{
buf = *pChar;
*pChar = *(pChar+1);
*(pChar+1) = buf;
pChar+= 2;
}
}
// Normalize De-Interleave the IQ data
double IwaveIn[POINTS];
double QwaveIn[POINTS];

Table of Contents

Other manuals for Keysight Technologies N5166B CXG

Questions and Answers:

Question and Answer IconNeed help?

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

Keysight Technologies N5166B CXG Specifications

General IconGeneral
BrandKeysight Technologies
ModelN5166B CXG
CategoryPortable Generator
LanguageEnglish

Related product manuals