Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1125

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

3
#
# Agilent VISA COM Example in Python for .NET or 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:\Program Files\IVI Foundation\VISA\VisaCom\
Primary Interop Assemblies")
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("Ivi.Visa.Interop")
from Ivi.Visa.Interop import *
# =========================================================
# Initialize:
# =========================================================
def initialize():
# Get and display the device's *IDN? string.
idn_string = do_query_string("*IDN?")
print "Identification string '%s'" % idn_string
# Clear status and load the default setup.
do_command("*CLS")
do_command("*RST")
# =========================================================
# Capture:
# =========================================================
def capture():
Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
If the Python for .NET "python.exe" and other files are placed in the
current directory, open a Command Prompt window; then, change to
the folder that contains the "example.py" file, and enter:
.\python.exe example.py
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
1125

Advertisement

Table of Contents
loading

Table of Contents