. . . continued
void 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 for
commands 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 time
to 250 ns and the pulse width to 10 us (the output frequency is set
to 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 <= 5; loop++)
{
waveform[loop] = (float)(loop-1)/5; /* Set rise time (5 points) */
}
for (loop = 6; loop <= 205; loop++)
{
waveform[loop] = 1; /* Set pulse width (10 points) */
}
for (loop = 206; loop <= 210; loop++)
{
waveform[loop] = (float)(210-loop)/5; /* Set fall time (5 points) */
}
6
Chapter 6 Application Programs
Downloading an Arbitrary Waveform over GPIB
257
Содержание 33120A
Страница 2: ......
Страница 10: ...8 ...
Страница 14: ...Contents Contents 12 ...
Страница 15: ...1 Quick Start 1 ...
Страница 31: ...2 Front Panel Menu Operation 2 ...
Страница 55: ...3 Features and Functions 3 ...
Страница 126: ...124 ...
Страница 127: ...4 Remote Interface Reference 4 ...
Страница 204: ...SCPI Status System Chapter 4 Remote Interface Reference The SCPI Status Registers 202 ...
Страница 228: ...226 ...
Страница 229: ...5 Error Messages 5 ...
Страница 244: ...242 ...
Страница 245: ...6 Application Programs 6 ...
Страница 272: ...270 ...
Страница 273: ...7 Tutorial 7 ...
Страница 299: ...8 Specifications 8 ...
Страница 304: ...302 ...