Python® 2.7 Code Example - Quantifi Photonics SLED 1000 Series User Manual

Superluminescent led light source
Table of Contents

Advertisement

11.3  Python® 2.7 code example
The following example shows how to communicate with the Quantifi Photonics product using Python code.
# You can get VXI11 from pip:
# pip install python-vxi11==0.9
import
vxi11
from
vxi11.vxi11
import
Vxi11Exception
# replace this with the IP of your device
ip =
"127.0.0.1"
try:
print("connecting to "
instrument = vxi11.Instrument(ip)
print("connected")
print("checking
IDN...")
command =
"*IDN?"
data = instrument.ask(command)
print("IDN: "
+ data)
print("checking
OPT...")
command =
"*OPT?"
data = instrument.ask(command)
print("OPT: "
+ data)
# replace this with a valid command for your device (read # the programming guide section for examples)
command =
""
print("writing a specific
instrument.write(command)
print("checking
ESR")
command =
"*ESR?"
data = instrument.ask(command)
print("*ESR?: "
+ data)
except
Vxi11Exception
as
e:
# pass
print("ERROR"
+ str(e) +
Quantifi Photonics | SLED 1000 / 1300 Series PXIe User Manual | Document version 1.08
+ ip +
" ...
")
command")
", command: "
+ str(command))
52 / 61

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sled 1300 series

Table of Contents