PXIe Platform Bit Error Rate Tester
|
BERTPXIe-1003/1005
Coherent Solutions Ltd.
Version
1.00
93
9.7.3
Python 2.7
The following code example shows how to communicate with a PXIe module using Python
®
.
# 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 "
+
ip
+
" ... "
)
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 command"
)
instrument.write
(
command
)
print(
"checking ESR"
)
command
=
"*ESR?"
data
=
instrument.ask
(
command
)
print(
"*ESR?: "
+
data
)
except
Vxi11Exception
as
e
:
# pass
print(
"ERROR"
+
str
(
e
)
+
", command: "
+
str
(
command
))
9.7.4
MATLAB
To communicate with the PXIe module in MATLAB
®
, a VISA IO driver must be installed. The
driver enables the creation of the interface object for instrument communication.
If you are developing locally on the PXIe platform, the driver is already installed. However, if
the development is on a remotely connected system, the VISA libraries, such as National
Instruments NI-VISA, must be installed.