Agilent Technologies Infiniium 8000A Programmer's Reference Manual page 108

Table of Contents

Advertisement

/* gen_srq.c */
/*
*
This example program initializes the 8000A
*
then generates and responds to a Service Request from the oscilloscope. The
* program assumes an 8000A at address 7, an interface card at interface select
*
code 7, and a waveform source attached to channel 1.
*/
#include <stdio.h>
#include "gpibdecl.h"
void initialize( void );
void setup_SRQ( void );
void create_SRQ( void );
void main( void )
{
if( init_IO( ) )
{
initialize( );/* initialize the oscilloscope and interface */
setup_SRQ( ); /* enable SRQs on oscilloscope and set up SRQ handler */
create_SRQ( );/* generate SRQ */
close_IO( );
}
} /* end main( ) */
Sample Programs
Sample C Programs
Sample C Program - Generating a Service Request
Segments of the sample C program "gen_srq.c" show how to initialize the
interface and oscilloscope, and generate a service request.
Two include statements start the "gen_srq.c" program. The file "stdio.h" defines
the standard location of the printf routine, and is needed whenever input or
output functions are used. The file "gpibdecl.h" includes necessary prototypes
and declarations for the Infiniium-Series Oscilloscopes sample programs. The
path of these files must specify the disk drive and directory where the "include"
files reside.
/* location of: printf() */
/* initialize interface and device sessions */
/* close interface and device sessions */
The routine "init_IO" contains three subroutines that initialize the oscilloscope
and interface, and sets up and generate a service request.
The following segment describes the initialize subroutine.
6-14
oscilloscope, runs an autoscale,

Advertisement

Table of Contents
loading

Table of Contents