892
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
12
Programming Examples
* Edit the DEVICE_ADDRESS line to specify the address of the
* applicable device.
*/
#include <stdio.h>
/* For printf(). */
#include "sicl.h"
/* SICL routines. */
/* #define DEVICE_ADDRESS "gpib0,7" */
/* GPIB */
/* #define DEVICE_ADDRESS "lan[a-mso6102-90541]:inst0" */
/* LAN */
#define DEVICE_ADDRESS "usb0[2391::5970::30D3090541::0]"
/* USB */
#define WAVE_DATA_SIZE 5000
#define TIMEOUT
5000
#define SETUP_STR_SIZE 3000
#define IMG_SIZE
300000
/* Function prototypes */
void initialize(void);
/* Initialize the oscilloscope. */
void extra(void);
/* Miscellaneous commands not executed,
shown for reference purposes. */
void capture(void);
/* Digitize data from oscilloscope. */
void analyze(void);
/* Make some measurements. */
void get_waveform(void);
/* Download waveform data from
oscilloscope. */
void save_waveform(void);
/* Save waveform data to a file. */
void retrieve_waveform(void);
/* Load waveform data from a file. */
/* Global variables */
INST id;
/* Device session ID. */
char buf[256] = { 0 };
/* Buffer for IDN string. */
/* Array for waveform data. */
unsigned char waveform_data[WAVE_DATA_SIZE];
double preamble[10];
/* Array for preamble. */
void main(void)
{
/* Install a default SICL error handler that logs an error message
* and exits.
On Windows 98SE or Windows Me, view messages with
* the SICL Message Viewer.
For Windows 2000 or XP, use the Event
* Viewer.
*/
ionerror(I_ERROR_EXIT);
/* Open a device session using the DEVICE_ADDRESS */
id = iopen(DEVICE_ADDRESS);
if (id == 0)
{
printf ("Oscilloscope iopen failed!\n");
}
else
{
printf ("Oscilloscope session initialized!\n");
/* Set the I/O timeout value for this session to 5 seconds. */
itimeout(id, TIMEOUT);
Summary of Contents for InfiniiVision 7000A Series
Page 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Page 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Page 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Page 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...