Technical data

Waveform Commands 32
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference 877
The format of the waveform data must match the format previously
specified by the :WAVeform:FORMat, :WAVeform:BYTeorder, and
:WAVeform:PREamble commands.
DATA? Example
for Analog
Channels
The following C example shows how to transfer WORD formatted waveform
data for analog channels to a computer.
/* readdata. c */
/* Reading Word format example. This program demonstrates the order
* of commands suggested for operation of the Infiniium oscilloscope
* via LAN. This program initializes the oscilloscope, acquires data,
* transfers data in WORD format, converts the data into time and
* voltage values, and stores the data in a file as comma-separated
* ascii values. This format is useful for spreadsheet and MATLAB
* applications. It requires a waveform which is connected to Channel 1.
*/
#include <stdio.h> /* location of: printf() */
#include <stdlib.h> /* location of: atof(), atoi() */
#include <string.h> /* location of: strlen() */
#include "sicl.h"
/* Prototypes */
int InitIO( void );
void WriteIO( char *buffer );
unsigned long ReadByte( char *buffer, unsigned long BytesToRead);
unsigned long ReadWord( char *buffer, int *reason,
unsigned long BytesToRead);
void ReadDouble( double *buffer );
void CloseIO( void );
void AcquireData( void );
void GetVoltageConversionFactors( double *yInc, double *yOrg );
void GetTimeConversionFactors( double *xInc, double *xOrg );
void WriteCsvToFile( unsigned long ByteToRead );
void SetupDataTransfer( void );
/* Defines */
#define MAX_LENGTH 10000000
#define INTERFACE "lan[130.29.70.247]:inst0"
#define TRUE 1
#define FALSE 0
#define IO_TIMEOUT 20000
/* Globals */
INST bus;
INST scope;
char buffer[MAX_LENGTH]; /* Buffer for reading data */
double xOrg=0L, xInc=0L; /* Values used to create time data */
double yOrg=0L, yInc=0L; /* Values used to convert data to volts */
void main( void )
{
unsigned long BytesToRead;