Agilent Technologies InfiniiVision 7000A Series Programmer's Manual page 846

Table of Contents

Advertisement

12
Programming Examples
* This program illustrates most of the commonly-used programming
* features of your Agilent oscilloscope.
* This program is to be built as a WIN32 console application.
* Edit the RESOURCE line to specify the address of the
* applicable device.
*/
#include <stdio.h>
#include <visa.h>
/* GPIB */
/* #define RESOURCE "GPIB0::7::INSTR" */
/* LAN */
/* #define RESOURCE "TCPIP0::a-mso6102-90541::inst0::INSTR" */
/* USB */
#define RESOURCE "USB0::2391::5970::30D3090541::0::INSTR"
#define WAVE_DATA_SIZE 5000
#define TIMEOUT
#define SETUP_STR_SIZE
#define IMG_SIZE
/* Function prototypes */
void initialize(void);
void extra(void);
void capture(void);
void analyze(void);
void get_waveform(void);
void save_waveform(void);
void retrieve_waveform(void);
/* Global variables */
ViSession defaultRM, vi;
char buf[256] = { 0 };
unsigned char waveform_data[WAVE_DATA_SIZE];
double preamble[10];
void main(void)
{
846
300000
/* Open session. */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, RESOURCE, VI_NULL,VI_NULL, &vi);
printf ("Oscilloscope session initialized!\n");
/* Clear the interface. */
viClear(vi);
initialize();
/* The extras function contains miscellaneous commands that do not
* need to be executed for the proper operation of this example.
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
/* For printf(). */
/* Agilent VISA routines. */
5000
3000
/* Initialize the oscilloscope. */
/* Miscellaneous commands not executed,
shown for reference purposes. */
/* Digitize data from oscilloscope. */
/* Make some measurements. */
/* Download waveform data from
oscilloscope. */
/* Save waveform data to a file. */
/* Load waveform data from a file. */
/* Device session ID. */
/* Buffer for IDN string. */
/* Array for preamble. */
/* Array for waveform
data. */

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents