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;
}
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...