Manual
175
viPrintf(vi,"*RST\n");
viPrintf(vi,"FUNCtion SINusoid\n"); //Select waveshape
// Other options are SQUare, RAMP, PULSe, NOISe, DC, and USER
viPrintf(vi,"OUTPut:LOAD 50\n"); //Set the load impedance in Ohms
//(50 Ohms default)
// May also be INFinity, as when using oscilloscope or DMM
viPrintf(vi,"FREQuency 12500\n"); //Set the frequency.
viPrintf(vi,"VOLTage 1.25\n"); //Set the amplitude in Vpp.
//Also see VOLTage:UNIT
viPrintf(vi,"VOLTage:OFFSet 0.5\n"); //Set the offset in Volts
//Voltage may also be set as VOLTage:HIGH and VOLTage:LOW for low level
//and high level
viPrintf(vi,"OUTPut ON\n"); // Turn on the instrument output
viClose (vi);
viClose (defaultRM);
}
Example: Amplitude Modulation
This program (found in the “Examples\ AM” subdirectory on the CDROM)
configures a waveform with amplitude modulation using lower-level SCPI
commands. It also shows how to use the *SAV command to store the instrument
configuration in the function generator’s internal memory.
//Amplitude Modulation
#include <visa.h>
#include <stdio.h>
void main (int argc,char *argv[])
{
ViSession defaultRM,vi=0;
ViStatus status;
char instrDesc[]="USB0::5710::
4002::TW00009009::0::INSTR";
viOpenDefaultRM (&defaultRM);










