. . . continued
void out_waveform(void)
{
/* Set up the burst waveform with a burst count of 1 and a starting
phase of 270 degrees. The burst waveform is a 5 kHz sine wave
with an output amplitude of 5 Vpp. An offset voltage of 2.5 Vdc
is added to create a "haversine" wave. The "triggered burst" mode is
used and the function generator will output a single burst when a
"bus" trigger is received over the GPIB interface. */
static char *cmd_string[]=
{
"OUTP:LOAD 50", /* Output termination is 50 ohms */
"APPL:SIN 5000,5", /* Carrier is a 5 kHz sine wave @ 5 Vpp */
"BM:NCYC 1", /* Burst count is 1 cycle */
"BM:PHAS 270", /* Starting phase is 270 degrees */
"VOLT:OFFS 2.5", /* Offset voltage is 2.5 Vdc */
"TRIG:SOUR BUS", /* Trigger source is "bus" */
"BM:STAT ON" /* Turn burst modulation on */
};
/* 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 a loop */
int loop;
for (loop = 0; loop < length; loop++)
{
IOOUTPUTS(ADDR, commands[loop], strlen(commands[loop]));
}
}
/**************************************************************************/
Chapter 6 Application Programs
Using the APPLy Command
250