Agilent Technologies Model A.08.xx Water Dispenser User Manual


 
132 Chapter 3
Programming Examples
Reading Trace Data Using 32-bit Real Format (RS-232)
scanf( "%c",&cEnter);
/*Externally route the 50MHz Signal*/
viPrintf(viESA,"CAL:SOUR:STAT ON \n");
}
}
void main()
{
/*Program Variables*/
ViStatus viStatus= 0;
ViChar _VI_FAR cResult[1024000] = {0};
ViReal32 dTraceArray[1024] = {0};
char cBufferInfo[7]= {0};
long lNumberBytes =0L;
long lOpc =0L;
unsigned long lRetCount = 0L;
int iSize = 0;
/*BytesPerPnt is 4 for Real32 or Int32 formats, 8 for Real64, and 2 for Uint16*/
int iBytesPerPnt = 4;
int iSwpPnts = 401; /*Number of points per sweep*/
int iDataBytes = 1604;/*Number of data points, assuming 4 bytes per point*/
int iHeaderBytes = 6; /*Number of bytes in the header, assuming 1604 data bytes*/
FILE *fTraceFile;
/* Open a serial session at COM1 */
viStatus=viOpenDefaultRM(&defaultRM);
if (viStatus =viOpen(defaultRM,"ASRL1::INSTR",VI_NULL,VI_NULL,&viESA) !=
VI_SUCCESS)
{
printf("Could not open a session to ASRL device at COM1!!\n");
exit(0);
}
/*Clear the instrument */
viClear(viESA);
/*Reset the instrument. This will set number of sweep points to default of 401*/
viPrintf(viESA,"*RST\n");
/*Display the program heading */
printf("\n\t\t Read in Trace Data using ASCII Format (using RS-232) Program \n\n"
);
/* Set the input port to the internal 50MHz reference source */
Route50MHzSignal();