Technical data

Table Of Contents
Waveform Commands 34
Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference 1107
* values are stored
* Return value: none
* Description: This routine converts the data to time values using
* the values that describe the waveform. These values ar
e stored
* in global variables.
************************************************************************
*****/
void CreateTimeData( unsigned long AcquiredLength, double *TimeValues )
{
unsigned long i;
for(i=0;i<AcquiredLength; i++) {
TimeValues[i] =((Start + i) * xInc) + xOrg; /* calculate time va
lues */
}
}
/***********************************************************************
*******
* Function name: WriteCsvToFile
* Parameters: double *TimeValues which is a pointer to an array of
* calculated time values
* unsigned short *wordData which is a pointer to an arr
ay of
* word format digital values
* unsigned char *byteData which is a pointer to an arra
yof
* byte format digital values
* unsigned long AcquiredLength which is the number of d
ata
* points read
* Return value: none
* Description: This routine stores the time and digital information
about
* the waveform as time, word format, and byte format
* separated by commas to a file.
************************************************************************
******/
void WriteCsvToFile( double *TimeValues, unsigned short *wordData,
unsigned char *byteData, unsigned long AcquiredLength )
{
FILE *fp;
char Binary[9];
unsigned long i;
int j;
int k;
fp = fopen( "digital.csv", "wb" ); /* Open file in binary mode - clear
file
if it already exists */
if (fp != NULL) {