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

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

Advertisement

#
# Agilent VISA COM Example in Python using "comtypes"
# *********************************************************
# This program illustrates a few commonly used programming
# features of your Agilent oscilloscope.
# *********************************************************
# Import Python modules.
# ---------------------------------------------------------
import string
import time
import sys
import array
from comtypes.client import GetModule
from comtypes.client import CreateObject
# Run GetModule once to generate comtypes.gen.VisaComLib.
if not hasattr(sys, "frozen"):
GetModule("C:\Program Files (x86)\IVI Foundation\VISA\VisaCom\
GlobMgr.dll")
import comtypes.gen.VisaComLib as VisaComLib
# Global variables (booleans: 0 = False, 1 = True).
# ---------------------------------------------------------
# =========================================================
# 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():
# Use auto-scale to automatically set up oscilloscope.
print "Autoscale."
do_command(":AUToscale")
# Set trigger mode.
do_command(":TRIGger:MODE EDGE")
qresult = do_query_string(":TRIGger:MODE?")
print "Trigger mode: %s" % qresult
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
python example.py
Programming Examples
827
38

Advertisement

Table of Contents
loading

Table of Contents