
912
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
38
Programming Examples
Console.WriteLine("Waveform X increment: {0:e}", dblXincrement)
Console.WriteLine("Waveform X origin: {0:e}", dblXorigin)
Console.WriteLine("Waveform X reference: {0:e}", nXreference)
Console.WriteLine("Waveform Y increment: {0:e}", dblYincrement)
Console.WriteLine("Waveform Y origin: {0:e}", dblYorigin)
Console.WriteLine("Waveform Y reference: {0:e}", nYreference)
' Read waveform data.
myScope.SCPI.WAVeform.DATA.QueryBYTE(byteResultsArray)
nLength = byteResultsArray.Length
Console.WriteLine("Number of data values: {0}", nLength)
' Set up output file:
strPath = "c:\scope\data\waveform_data.csv"
If File.Exists(strPath) Then
File.Delete(strPath)
End If
' Open file for output.
Dim writer As StreamWriter = File.CreateText(strPath)
' Output waveform data in CSV format.
For i As Integer = 0 To nLength - 2
writer.WriteLine("{0:f9}, {1:f6}", _
dblX (CSng(i) * dblXincrement), _
((CSng(byteResultsArray(i)) - nYreference) * _
dblYincrement) + dblYorigin)
Next
' Close output file.
writer.Close()
Console.WriteLine("Waveform format BYTE data written to {0}", _
strPath)
End Sub
End Class
End Namespace
SCPI.NET Example in IronPython
You can also control Agilent oscilloscopes using the SCPI.NET library and
Python programming language on the .NET platform using:
•
IronPython (
"http://ironpython.codeplex.com/"
) which is an
implementation of the Python programming language running under
.NET.
To run this example with IronPython:
1
Install the Agilent Command Expert software and the command set for
the oscilloscope.
2
Cut- and- paste the code that follows into a file named "example.py".
3
Edit the program to use the address of your oscilloscope.
Summary of Contents for InfiniiVision 2000 X-Series
Page 1: ...s1 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Page 24: ...24 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide...
Page 38: ...38 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 1 What s New...
Page 48: ...48 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 62: ...62 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 206: ...206 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands...
Page 242: ...242 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 11 DEMO Commands...
Page 250: ...250 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 12 DIGital d Commands...
Page 270: ...270 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 14 DVM Commands...
Page 312: ...312 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 17 HARDcopy Commands...
Page 332: ...332 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 19 MARKer Commands...
Page 416: ...416 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 22 POD Commands...
Page 424: ...424 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 23 RECall Commands...
Page 446: ...446 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 24 SAVE Commands...
Page 588: ...588 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 28 TIMebase Commands...
Page 692: ...692 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 31 WGEN Commands...
Page 758: ...758 Agilent InfiniiVision 2000 X Series Oscilloscopes Programmer s Guide 34 Error Messages...