Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1211

X-series
Hide thumbs Also See for InfiniiVision 3000:
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("AgInfiniiVision3000X_01_20")
from Agilent.CommandExpert.ScpiNet.AgInfiniiVision3000X_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 3000 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.
39
1211

Advertisement

Table of Contents
loading

Table of Contents