Specifications
Chapter 17 273
ESA Programming Examples
Using C to Make Faster Power Averaging Measurements
ESA Programming Examples
{
/*Set the input port to the 50MHz amplitude reference for the models*/
/*E4401B, E4411B and E7401A*/
viPrintf(viESA,":DISP:WIND:TRAC:Y:RLEV -25 DBM\n");
viPrintf(viESA,"CAL:SOUR:STAT ON \n");
}
else 
{
/* For the analyzers having frequency limits >= 3GHz, prompt the user*/
/* to connect the amplitude reference output to the input*/
printf ("Connect AMPTD REF OUT to the INPUT \n");
printf ("......Press Return to continue \n");
scanf( "%c",&cEnter);
/*Externally route the 50MHz Signal*/
viPrintf(viESA, ":DISP:WIND:TRAC:Y:RLEV -20 DBM\n");
viPrintf(viESA,"CAL:SOUR:STAT ON \n");
}
 /* Single sweep mode      */
  viPrintf(viESA, ":INIT:CONT OFF\n");
 /* Turn off the local display to maximize measurement rate */
  if(!DISPLAY)  {
  viPrintf(viESA, ":DISP:ENAB OFF\n");
  }
 /* transfer data in definite length,32 bit integer blocks. Select  */
 /* machine units (milli-dBm) to maximize measurement rate  */
  viPrintf(viESA, ":FORM:DATA INT,32\n" );
 /* select the byte order; low-byte first for Intel platforms  */
  /* To further increase measurement rate,:FORM:BORD NORM could   */
 /* be used instead. The byte ordering would then need to be */
 /* done within this program.   */
  viPrintf(viESA, ":FORM:BORD SWAP\n");
 /* pre-calculate amount of data to be transferred per measurement  */
  iTermLength = 1;
  iArrayLength = iNumPoints * DATA_LENGTH; 
  iHeaderLength = HeaderLength(iArrayLength); 
  iBlockSize = iHeaderLength + iArrayLength + iTermLength;
}










