Programming Examples 36
Keysight InfiniiVision DSOX1204A/G Oscilloscopes Programmer's Guide 907
Console.ReadKey()
End Sub
End Class
End Namespace
VISA.NET Example in IronPython
You can also control Keysight oscilloscopes using the VISA.NET library and Python
programming language on the .NET platform using:
• IronPython (http://ironpython.net/) which is an implementation of the Python
programming language running under .NET.
To run this example with IronPython:
1 Cut-and-paste the code that follows into a file named "example.py".
2 Edit the program to use the address of your oscilloscope.
3 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
#
# Keysight VISA.NET Example in IronPython
# *********************************************************
# This program illustrates a few commonly used programming
# features of your Keysight InfiniiVision oscilloscope.
# *********************************************************
# Import Python modules.
# ---------------------------------------------------------
import sys
sys.path.append("C:\Python27\Lib") # Python Standard Library.
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")
from Ivi.Visa import *
from Ivi.Visa.FormattedIO import *
# =========================================================
# Initialize:
# =========================================================
def initialize():
# Get and display the device's *IDN? string.