. . . continued
void out_waveform(void)
{
/* Set the output frequency to 5 kHz with an amplitude of 10 Vpp and
output the arbitrary waveform. */
static char *cmd_string[]=
{
/* Copy arb waveform to non-volatile memory with name "PULSE" */
"DATA:COPY PULSE, VOLATILE",
"FUNC:USER PULSE", /* Select the active arb waveform */
"FUNC:SHAP USER" /* Output the selected arb waveform */
};
/* Call the function to execute the command strings shown above */
command_exe(cmd_string, sizeof(cmd_string)/sizeof(char*));
/* Call the function to check for errors */
check_error("out_waveform");
}
/**************************************************************************/
void command_exe(char *commands[], int length)
{
/* Execute one command string at a time using loop */
int loop;
for (loop = 0; loop < length; loop++)
{
IOOUTPUTS(ADDR, commands[loop], strlen(commands[loop]));
}
/* Set output termination to 50 ohms and output frequency to 5 kHz @ 5 Vpp */
IOOUTPUTS(ADDR, "OUTP:LOAD 50", 12);
IOOUTPUTS(ADDR, "FREQ 5000;VOLT 5", 16);
}
/**************************************************************************/
6
Chapter 6 Application Programs
Downloading an Arbitrary Waveform over GPIB
259