C / GPIB (Program 4)
/***************************************************************************
This program uses the Agilent 33120A Status Registers to generate an
interrupt if a SCPI error is detected. The function generator is
programmed to output an FM waveform.
***************************************************************************/
#include <stdio.h> /* Used for printf() */
#include <stdlib.h> /* Used for atoi() */
#include <string.h> /* Used for strlen() */
#include <cfunc.h> /* Header file from GPIB Command Library */
#define ISC 7L /* Assign GPIB select code */
#define ADDR 710L /* Set GPIB address for function generator */
/* Function Prototypes */
void rst_clear(void);
void setup_status(void);
void out_waveform(void);
void command_exe(char *commands[], int length);
void check_error(char *func_name);
/**************************************************************************/
void main(void) /* Start of main() */
{
rst_clear(); /* Reset the instrument and clear error queue */
setup_status(); /* Set up 33120A status registers */
out_waveform(); /* Set up frequency sweep parameters */
}
/**************************************************************************/
6
Chapter 6 Application Programs
Using the Status Registers
263