Keysight E4428C ESG RF Programming Manual page 284

Signal generators
Table of Contents

Advertisement

Creating and Downloading Waveform Files
Programming Examples
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;
}
unsigned char* buf = new unsigned char[BUFFER_SIZE]; // Allocate char buffer memory
if (buf && lenToSend)
{
// Do not send the EOI (end of instruction) terminator on any write except the
// last one
viSetAttribute( vi, VI_ATTR_SEND_END_EN, 0 );
// Prepare and send the SCPI command header
char s[20];
sprintf(s, "%d", lenToSend);
int lenLen = strlen(s);
unsigned char s2[256];
// Write the command mmem:data and the header.The number lenLen represents the
// number of bytes and the actual number of bytes is the variable lenToSend
sprintf((char*)s2, "mmem:data \"%s\", #%d%d", instDestFile, lenLen, lenToSend);
// Send the command and header to the signal generator
276
Keysight Signal Generators Programming Guide

Advertisement

Table of Contents
loading

Table of Contents