. . . continued
300 ! Download data points to volatile memory from array
310 !
320 DISP "Downloading Arb..."
330 OUTPUT @Fgen;"DATA VOLATILE,";Waveform(*)
340 DISP "Download Complete"
350 !
360 OUTPUT @Fgen;"DATA:COPY PULSE, VOLATILE" ! Copy arb to non-volatile memory
370 OUTPUT @Fgen;"FUNC:USER PULSE" ! Select the active arb waveform
380 OUTPUT @Fgen;"FUNC:SHAP USER" ! Output the selected arb waveform
390 !
400 OUTPUT @Fgen;"OUTP:LOAD 50" ! Output termination is 50 ohms
410 OUTPUT @Fgen;"FREQ 5000;VOLT 5" ! Output frequency is 5 kHz @ 5 Vpp
420 !
430 END
C / GPIB (Program 3)
/***************************************************************************
This program uses the arbitrary waveform function to download and
output a square wave pulse with a calculated rise time and fall time.
The waveform consists of 4000 points downloaded over the GPIB
interface as ASCII data.
***************************************************************************/
#include <stdio.h> /* Used for printf() */
#include <stdlib.h> /* Used for malloc(), free(), 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 get_data(void);
void download_data(float *waveform, int num_points);
void out_waveform(void);
void command_exe(char *commands[], int length);
void check_error(char *func_name);
/**************************************************************************/
Chapter 6 Application Programs
Downloading an Arbitrary Waveform over GPIB
256