Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual page 913

Oscilloscopes
Hide thumbs Also See for InfiniiVision 2000 X-Series:
Table of Contents

Advertisement

4
#
# 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")
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("AgInfiniiVision2000X_01_20")
from Agilent.CommandExpert.ScpiNet.AgInfiniiVision2000X_01_20 import *
# =========================================================
# Initialize:
# =========================================================
def initialize():
# Get and display the device's *IDN? string.
idn_string = scope.SCPI.IDN.Query()
print "Identification string '%s'" % idn_string
# Clear status and load the default setup.
scope.SCPI.CLS.Command()
scope.SCPI.RST.Command()
# =========================================================
# Capture:
# =========================================================
def capture():
# Use auto-scale to automatically set up oscilloscope.
print "Autoscale."
scope.SCPI.AUToscale.Command(None, None, None, None, None)
# Set trigger mode.
scope.SCPI.TRIGger.MODE.Command("EDGE")
qresult = scope.SCPI.TRIGger.MODE.Query()
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
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
Programming Examples
# Python Standard Library.
38
913

Advertisement

Table of Contents
loading

Table of Contents