Chapter 3 181
ProgrammingExamples
Making Faster Measurements (multiple measurements)
viPrintf(viESA,":DISP:WIND:TRAC: Y:RLEV -25 DBM\n");
viPrintf(viESA,"CAL:SOUR:STAT ON \n");
}
else
{
/* For the analyzers having frequ ency limits >= 3GHz, prompt the use r*/
/* to connect the amplitude refer ence output to the input*/
printf ("Connect AMPTD REF OUT to the INPUT \n");
printf ("......Press Return to co ntinue \n");
scanf( "%c",&cEnter);
/*Externally route the 50MHz Sign al*/
viPrintf(viESA, ":DISP:WIND:TRAC: Y:RLEV -20 DBM\n");
viPrintf(viESA,"CAL:SOUR:STAT ON \n");
}
/* Single sweep mode */
viPrintf(viESA, ":INIT:C ONT OFF\n");
/* Turn off the local display to maximize measurement rate */
if(!DISPLAY) {
viPrintf(viESA, ":DI SP:ENAB OFF\n");
}
/* transfer data in definite length,32 bit integer blocks. Sele ct */
/* machine units (milli-dBm) to maximize measurement rate */
viPrintf(viESA, ":FORM:D ATA INT,32\n" );
/* select the byte order; low-byte first for I ntel platforms */
/* To further increase measurement rate,:FORM:BOR D NORM could */
/* be used instead. The byte ordering w ould then need to be */
/* done within this program. */
viPrintf(viESA, ":FORM:B ORD SWAP\n");
/* pre-calculate amount of data to be transferred per measureme nt */
iTermLength = 1;
iArrayLength = iNumPoint s * DATA_LENGTH;
iHeaderLength = HeaderLe ngth(iArrayLength);
iBlockSize = iHeaderLeng th + iArrayLength + iTermLength;
}
/**************** Write bi nary trace data to ESA *******************/
void write_binary_trace(char *cS cpiCommand, int *ipTraceData) {