EasyManua.ls Logo

Keysight Technologies X Series - Page 272

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
Loading...
272 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
status = viOpen(defaultRM, instOpenString, VI_NULL, VI_NULL,
&vi);
if (status)// If any errors then display the error and exit the
program
{
fprintf(stderr, "viOpen failed (%s)\n", instOpenString);
return -1;
}
FILE* file = fopen(localSrcFile, "rb");// Open local source file
for binary reading
if (!file) // If any errors display the error and exit the
program
{
fprintf(stderr, "Could not open file: %s\n", localSrcFile);
return 0;
}
if( fseek( file, 0, SEEK_END ) < 0 )
{
fprintf(stderr,"Cannot lseek to the end of file.\n" );
return 0;
}
long lenToSend = ftell(file);// Number of bytes in the file
printf("File size = %d\n", lenToSend);
if (fseek(file, 0, SEEK_SET) < 0)
{
fprintf(stderr,"Cannot lseek to the start of file.\n");
return 0;
}

Table of Contents

Other manuals for Keysight Technologies X Series

Related product manuals