Agilent Technologies 2000 X-Series Instrukcja Obsługi Strona 827

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 930
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 826
Programming Examples 38
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide 827
python example.py
#
# 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
Przeglądanie stron 826
1 2 ... 822 823 824 825 826 827 828 829 830 831 832 ... 929 930

Komentarze do niniejszej Instrukcji

Brak uwag