Technical data
Sample Programs 35
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference 1063
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:
ipy example.py
#
# Agilent SCPI.NET Example in IronPython
# *********************************************************
# This program illustrates a few commonly used programming
# features of your Agilent oscilloscope.
# *********************************************************
# Import Python modules.
# ---------------------------------------------------------
import sys
sys.path.append("C:\Python26\Lib") # Python Standard Library.
sys.path.append("C:\ProgramData\Agilent\Command Expert\ScpiNetDrivers")
import string
# Import .NET modules.
# ---------------------------------------------------------
from System import *
from System.IO import *
from System.Text import *
from System.Runtime.InteropServices import *
import clr
clr.AddReference("AgInfiniium90000_3_10")
from Agilent.CommandExpert.ScpiNet.AgInfiniium90000_3_10 import *
# =========================================================
# Initialize:
# =========================================================
def initialize():