11.07.2015 Views

Agilent 33120A User's Guide

Agilent 33120A User's Guide

Agilent 33120A User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6 Application ProgramsDownloading an Arbitrary Waveform over GPIB. . . continuedvoid main(void) /* Start of main() */{rst_clear(); /* Reset the instrument and clear error queue */get_data(); /* Calculate the waveform data points */out_waveform(); /* Download points and output arb waveform */}/**************************************************************************/void rst_clear(void){/* Reset the function generator, clear the error queue, and wait forcommands to complete. A "1" is sent to the output buffer from the*OPC? command when *RST and *CLS are completed. */}float value;IOOUTPUTS(ADDR, "*RST;*CLS;*OPC?", 15);IOENTER(ADDR, &value);/**************************************************************************/void get_data(void){/* Load 4000 points into an array to set the rise time and fall timeto 250 ns and the pulse width to 10 us (the output frequency is setto 5 kHz in the "out_waveform" function). */float *waveform;int loop, num_points = 4000;waveform = (float*) malloc (num_points * sizeof(float));for (loop = 1; loop

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!