Technical data

Table Of Contents
Sample Programs 38
Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference 1297
myScope.SCPI.WAVeform.YORigin.Query(fYorigin)
' Get the waveform data.
myScope.SCPI.WAVeform.STReaming.Command(False)
Dim WordDataArray As Short()
' Results array.
myScope.SCPI.WAVeform.DATA.QueryWord(DBNull.Value, _
DBNull.Value, WordDataArray)
nLength = WordDataArray.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=0TonLength - 2
writer.WriteLine("{0:f9}, {1:f6}", _
fXorigin + (CSng(i) * fXincrement), _
(CSng(WordDataArray(i)) * fYincrement) + fYorigin)
Next
' Close output file.
writer.Close()
Console.WriteLine("Waveform format WORD 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.
4 If the IronPython "ipy.exe" can be found via your PATH environment
variable, open a Command Prompt window; then, change to the folder
that contains the "example.py" file, and enter: