20.01.2015 Views

Programming Guide DS2000 Series Digital Oscilloscope

Programming Guide DS2000 Series Digital Oscilloscope

Programming Guide DS2000 Series Digital Oscilloscope

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RIGOL<br />

3 <strong>Programming</strong> Demos<br />

C# <strong>Programming</strong> Demo<br />

The function of the program: read the device information.<br />

1. Build a project. Find visa32.cs in the installation directory of VISA and add it to<br />

the project. After that, visa32.cs is added to the Solution Explorer and the<br />

type visa32 is introduced in.<br />

2. Open the resource manager and then turn on the instrument (you need to set<br />

the descriptor).<br />

Const string<br />

Cdevice_INSTR=@"USB0::0x1AB1::0x04B0::DS2A0000000001::INSTR"<br />

viError=visa32.viOpenDefaultRM(out viDefRm);<br />

viError=visa32.viOpen(viDefRm,cDEVICE_INSTR,0,5000,out viSession);<br />

3. Send the request and read the data.<br />

visa32.viPrintf(viSession,"*IND\n");<br />

byteReadBuf = new byte[128];<br />

visa32.viRead(viSession,byteReadBuf,128,outretCnt);<br />

The data read (in byte format) needs to be converted to string.<br />

StrIdn="";<br />

For(i=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!