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

Automated optical switch
Hide thumbs Also See for 1000 Series:
Table of Contents

Advertisement

Python® 2.7 code example
The following example shows how to communicate with a Switch product using Python code. For a list of
supported and valid SCPI commands, refer to the Programming Guide.
# You can get VXI11 from pip:
# pip install python-vxi11==0.9
import
vxi11
from
vxi11.vxi11
# replace this with the IP of your device
ip
=
"127.0.0.1"
try:
print("connecting to "
instrument
print("connected")
print("checking
command
data
= instrument.ask(command)
print("IDN: "
print("checking
command
data
= instrument.ask(command)
print("OPT: "
# 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
command
data
= instrument.ask(command)
print("*ESR?: "
except
Vxi11Exception
# pass
print("ERROR"
Quantifi Photonics Ltd.
Automated Optical Switch | Switch 1000/1100/1400 Series
import
Vxi11Exception
+
ip
= vxi11.Instrument(ip)
IDN...")
=
"*IDN?"
+ data)
OPT...")
=
"*OPT?"
+ data)
=
""
command")
ESR")
=
"*ESR?"
+ data)
as e:
+ str(e) +
", command: "
Version
+
" ...
")
+ str(command))
3.04
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

1100 series1400 series

Table of Contents