Visa Example In C - Agilent Technologies MSO6102A Programmer's Reference Manual

6000 series
Hide thumbs Also See for MSO6102A:
Table of Contents

Advertisement

VISA Example in C

/*
* Agilent VISA Example in C
* ------------------------------------------------------------------
* 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)
{
Agilent 6000 Series Oscilloscopes Programmer's Reference
300000
/* Open session. */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM, RESOURCE, VI_NULL,VI_NULL, &vi);
printf ("Oscilloscope session initialized!\n");
/* 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. */
Programming Examples
/* Array for waveform
data. */
9
595

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents