268 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
{
fprintf(stderr, "iopen failed (%s)\n", instOpenString);
return -1;
}
FILE* file = fopen(localSrcFile, "rb");
if (!file)
{
fprintf(stderr, "Could not open file: %s\n", localSrcFile);
return 0;
}
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);
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...