BNC 645 User Manual

Page 178

Advertising
background image

178

edge

time is then incremented.

//A Pulse Waveform

#include <visa.h>

#include <stdio.h>

#include <windows.h>

void main (int argc,char *argv[])

{

ViSession

defaultRM,vi=0;

ViStatus

status;

char

instrDesc[]="USB0::5710::4002::TW00009009::0::INSTR";

int

i;

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 pulse waveshape and adjusts the edge

//time. It also shows the use of high and low voltage levels

//and period. The edge time is adjusted by 5 nsec increments.

viPrintf(vi,"*RST\n");

viPrintf(vi,"FUNCtion

PULSe\n");

//Select pulse waveshape

viPrintf(vi,"OUTPut:LOAD 50\n");

//Set the load impedance to

// 50 Ohms (default)

viPrintf(vi,"VOLTage:LOW 0\n");

//Low level = 0 V

viPrintf(vi,"VOLTage:HIGH 0.75\n");

//High level = .75 V

viPrintf(vi,"PULSe:PERiod

1e-3\n");

//1 ms intervals

viPrintf(vi,"PULSe:WIDTh

100e-6\n"); //Pulse width is 100 us

viPrintf(vi,"PULSe:TRANsition 10e-9\n");//Edge time is 10 ns

//(rise time = fall time)

viPrintf(vi,"OUTPut

ON\n");

//Turn on the instrument output

Advertising