Bnc 645 User Manual Page 179

  • Download
  • Add to my manuals
  • Print
  • Page
    / 190
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 178
179
for(i=0;i<19;i++){ //Vary edge by 5 nsec steps
viPrintf(vi,"PULSe:TRANsition %E\n",0.00000001 + i * 0.000000005);
Sleep(300); //Wait 300 msec
}
viClose (vi);
viClose (defaultRM);
}
Example: Pulse Width Modulation (PWM)
This program (found in the “Examples\PWM” subdirectory on the
CD-ROM) configures a pulse waveform with duty cycle, which is then slowly
modulated
by a triangle waveform.
//Pulse Width Modulation (PWM)
#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);
status = viOpen(defaultRM,instrDesc, VI_NULL,VI_NULL, &vi);
if (status != VI_SUCCESS){
printf("Can not Open device:\"%s\"\n",instrDesc);
return;
}
//This program uses low-level SCPI commands to configure
//the function gnerator to output an PWM waveform.
//The pulse is set up with a duty cycle of 35% and a depth
//of 15%, and will vary in width from 20% to 50% with the
Page view 178
1 2 ... 174 175 176 177 178 179 180 181 182 183 184 ... 189 190

Comments to this Manuals

No comments