Bnc 645 User Manual Page 177

  • Download
  • Add to my manuals
  • Print
  • Page
    / 190
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 176
177
void main (int argc,char *argv[])
{
ViSession defaultRM,vi=0;
ViStatus status;
char instrDesc[]="USB0::5710::
4002::TW00009009::0::INSTR";
viOpenDefaultRM (&defaultRM);
status = viOpen(defaultRM,instrDesc, VI_NULL,VI_NULL, &vi);
if (status != VI_SUCCESS){
printf("Can not Open device:\"%s\"\n",instrDesc);
return;
}
//This program sets up a linear sweep using a sinusoid
//waveform. It sets the start and stop frequency and sweep
//time.
viPrintf(vi,"*RST\n");
viPrintf(vi,"FUNCtion SINusoid\n"); //Select waveshape
viPrintf(vi,"OUTPut:LOAD 50\n"); //Set the load impedance to
// 50 Ohms (default)
viPrintf(vi,"VOLTage 1\n"); //Set the amplitude to 1 Vpp.
viPrintf(vi,"SWEep:SPACing LINear\n"); //Set Linear or LOG spacing
viPrintf(vi,"SWEep:TIME 1\n"); //Sweep time is 1 second
viPrintf(vi,"FREQuency:STARt 100\n"); //Start frequency is 100 Hz
viPrintf(vi,"FREQuency:STOP 20e3\n"); //Stop frequency is 20 kHz
//Frequency sweep limits may also be set as FREQuency:CENTer and
viPrintf(vi,"OUTPut ON\n"); //Turn on the instrument output
viPrintf(vi,"SWEep:STATe ON\n"); //Turn sweep on
viClose (vi);
viClose (defaultRM);
}
Example: A Pulse Waveform
This program (found in the “Examples\Pulse” subdirectory on the CD-ROM)
configures a pulse waveform, setting pulse width, period, and high/low levels. The
Page view 176
1 2 ... 172 173 174 175 176 177 178 179 180 181 182 ... 189 190

Comments to this Manuals

No comments