Visa Example In Python - Agilent Technologies Infiniium 90000 Series Programmer's Manual

Oscilloscopes
Hide thumbs Also See for Infiniium 90000 Series:
Table of Contents

Advertisement

38
Sample Programs
End Namespace

VISA Example in Python

You can use the Python programming language with the PyVISA package
to control Agilent Infiniium Series oscilloscopes.
The Python language and PyVISA package can be downloaded from the
web at
respectively.
To run this example with Python and PyVISA:
1
2
3
# *********************************************************
# This program illustrates a few commonly-used programming
# features of your Agilent Infiniium Series oscilloscope.
# *********************************************************
# Import modules.
# ---------------------------------------------------------
import visa
import string
import struct
import sys
# Global variables (booleans: 0 = False, 1 = True).
# ---------------------------------------------------------
debug = 0
# =========================================================
# Initialize:
# =========================================================
def initialize():
# Clear status.
1102
End Sub
Public Sub Close()
If m_nSession <> 0 Then
visa32.viClose(m_nSession)
End If
If m_nResourceManager <> 0 Then
visa32.viClose(m_nResourceManager)
End If
End Sub
End Class
"http://www.python.org/"
Cut- and- paste the code that follows into a file named "example.py".
Edit the program to use the VISA address of your oscilloscope.
If "python.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:
python example.py
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference
and "http://pyvisa.sourceforge.net/",

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents