Technical data
150 Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz
5 Creating and Downloading User-Data Files
//pairsList[n]=0;
for (int i=0; i < num; i++)
{
char* nextFreq = new char[MAX_STRING_LENGTH+1]; //frequency array
char* nextPower = new char[MAX_STRING_LENGTH+1];//amplitude array
//enter frequency and amplitude pairs i.e 10ghz .1db
printf("Enter Freq %d: ", i+1);
scanf("%s", nextFreq);
printf("Enter Power %d: ",i+1);
scanf("%s", nextPower);
pairsList[2*i] = nextFreq;//frequency
pairsList[2*i+1]=nextPower;//power correction
}
unsigned char str[256];//buffer used to hold SCPI command
//initialize the signal generator's user flatness table
sprintf((char*)str,":corr:flat:pres\n"); //write to buffer
viWrite(vi, str,strlen((char*str),0); //write to PSG
char c = ',';//comma separator for SCPI command
for (int j=0; j< num; j++) //download pairs to the PSG
{
sprintf((char*)str,":corr:flat:pair %s %c %s\n",pairsList[2*j], c, pairsList[2*j+1]);
// << on SAME line!
viWrite(vi, str,strlen((char*)str),0);
}
//store the downloaded correction pairs to PSG memory
const char* fileName = "flatCal_data";//user flatness file name
//write the SCPI command to the buffer str
sprintf((char*)str, ":corr:flat:store \"%s\"\n", fileName);//write to buffer