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 #253 background imageLoading...
Page #253 background image
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 243
Creating and Downloading Waveform Files
Programming Examples
if( fseek( file, 0, SEEK_END ) < 0 )
{
fprintf(stderr,"Cannot seek to the end of file.\n" );
return 0;
}
long lenToSend = ftell(file);
printf("File size = %d\n", lenToSend);
if (fseek(file, 0, SEEK_SET) < 0)
{
fprintf(stderr,"Cannot seek to the start of file.\n");
return 0;
}
char* buf = new char[BUFFER_SIZE];
if (buf && lenToSend)
{
// Prepare and send the SCPI command header
char s[20];
sprintf(s, "%d", lenToSend);
int lenLen = strlen(s);
char s2[256];
sprintf(s2, "mmem:data \"%s\", #%d%d", instDestFile, lenLen, lenToSend);
iwrite(id, s2, strlen(s2), 0, 0);
// Send file in BUFFER_SIZE chunks
long numRead;
do
{
numRead = fread(buf, sizeof(char), BUFFER_SIZE, file);
iwrite(id, buf, numRead, 0, 0);
} while (numRead == BUFFER_SIZE);
// Send the terminating newline and EOM
iwrite(id, "\n", 1, 1, 0);
delete [] buf;
}
else
{

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