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 />

2 Command System<br />

}<br />

stpWatch.Start();<br />

s32ReadByte = TestReadWfm(viSession, args[0], args[1] );<br />

stpWatch.Stop();<br />

Console.WriteLine( "Speed is {0} KB/s",<br />

s32ReadByte/stpWatch.ElapsedMilliseconds );<br />

DeInitVisa(viDef, viSession);<br />

Console.WriteLine( "Press any key to continue.");<br />

Console.ReadKey();<br />

}<br />

static Int32 TestReadWfm(Int32 viSession, string strChan, string strFile )<br />

{<br />

byte []wfmBuf;<br />

Int32 readCnt = 0;<br />

Int32 readSum = 0;<br />

Int32 readTim = 0;<br />

Int32 maxPacket=0;<br />

StringBuilder strBuild;<br />

Stream streamOut;<br />

BinaryWriter wfmStream;<br />

wfmBuf = new byte[1024*1024*10];<br />

strBuild = new StringBuilder(256);<br />

visa32.viPrintf(viSession, ":STOP\n");<br />

visa32.viPrintf(viSession, ":WAV:MODE RAW\n");<br />

visa32.viPrintf(viSession, ":WAV:SOURce %s\n", strChan );<br />

visa32.viPrintf(viSession, ":WAV:RESet\n");<br />

visa32.viPrintf(viSession, ":WAV:BEGin\n");<br />

//read buffer to WFM<br />

streamOut = File.Create( strFile , 10000000);<br />

wfmStream = new BinaryWriter(streamOut);<br />

while (true)<br />

{<br />

//Thread.Sleep( 10000 );<br />

visa32.viPrintf(viSession, ":WAV:STATus\n");<br />

visa32.viScanf(viSession, "%s", strBuild);<br />

2-556 <strong>DS2000</strong> <strong>Programming</strong> <strong>Guide</strong><br />

2-556

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

Saved successfully!

Ooh no, something went wrong!