Connections¤
The information about how to interface with equipment for computer control is defined in the eXtensible Markup Language (XML) file format. You specify the XML file that contains the connection information as a <connections>
element in your configuration file. When the configuration file is loaded, it links a Connection instance with the corresponding Equipment instance. You may also define the connection information directly in a Python module, instead of in XML files.
XML¤
Schema¤
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="connections">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="connection">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="eid" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The equipment ID from an equipment register.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="address" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
The VISA-style address to use for the connection.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="backend" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The backend package to use to communicate with the equipment.
Default is MSL if not defined.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="MSL"/>
<xsd:enumeration value="PyVISA"/>
<xsd:enumeration value="NIDAQ"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="manufacturer" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The name of the manufacturer of the equipment.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="model" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The model number of the equipment.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="serial" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
The serial number (or unique identifier) of the equipment.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="properties" minOccurs="0">
<xsd:annotation>
<xsd:documentation>
Additional name-value pairs that are required to communicate with the equipment.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Example¤
Address Syntax¤
The following are examples of VISA-style addresses that may be used to connect to equipment.
Interface | Address | Description |
---|---|---|
GPIB | GPIB::10 | GPIB device at board=0 (default), primary address=10, no secondary address |
GPIB | GPIB0::voltmeter | GPIB device at board=0, interface name="voltmeter" (see gpib.conf for more details about the "name" option) |
GPIB | GPIB1::6::97::INSTR | GPIB device at board=1, primary address=6, secondary address=97 |
GPIB | GPIB2::INTFC | GPIB interface at board=2 |
HiSLIP | TCPIP::dev.company.com::hislip0 | A HiSLIP LAN instrument, host=dev.company.com |
HiSLIP | TCPIP::10.12.114.50::hislip0,5000::INSTR | A HiSLIP LAN instrument, host=10.12.114.50, port=5000 |
PROLOGIX | Prologix::192.168.1.110::1234::6 | The GPIB-ETHERNET Controller, host=192.168.1.110, port=1234, primary GPIB address=6 |
PROLOGIX | Prologix::192.168.1.70::1234::6::112 | The GPIB-ETHERNET Controller, host=192.168.1.70, port=1234, primary GPIB address=6, secondary GPIB address=112 |
PROLOGIX | Prologix::192.168.1.70::1234::GPIB::6::112 | The GPIB-ETHERNET Controller, host=192.168.1.70, port=1234, primary GPIB address=6, secondary GPIB address=112 |
PROLOGIX | Prologix::COM3::6 | The GPIB-USB Controller, port=COM3, primary GPIB address=6 |
PROLOGIX | Prologix::COM3::GPIB::6 | The GPIB-USB Controller, port=COM3, primary GPIB address=6 |
PROLOGIX | Prologix::/dev/ttyS0::4::96 | The GPIB-USB Controller, port=/dev/ttyS0, primary GPIB address=4, secondary GPIB address=96 |
SDK | SDK::C:/Manufacturer/library.dll | Specify the full path to the SDK |
SDK | SDK::library.dll | Specify only the filename if the path to where the SDK file is located has been added to the PATH environment variable |
SERIAL | COM2 | A serial port on Windows |
SERIAL | ASRL/dev/ttyS1 | A serial port on Linux |
SERIAL | ASRL2::INSTR | Compatible with National Instruments syntax |
SERIAL | ASRLCOM2 | Compatible with PyVISA-py syntax |
SOCKET | TCP::192.168.1.100::5000 | Use the TCP protocol, host=192.168.1.100, port=5000 |
SOCKET | UDP::192.168.1.100::5000 | Use the UDP protocol, host=192.168.1.100, port=5000 |
SOCKET | TCPIP::192.168.1.100::5000::SOCKET | Compatible with National Instruments syntax |
VXI-11 | TCPIP::dev.company.com::INSTR | A VXI-11.3 LAN instrument, host=dev.company.com (uses the default LAN Device Name inst0) |
VXI-11 | TCPIP::10.6.56.21::gpib0,2::INSTR | A VXI-11.2 GPIB device, host=10.6.56.21, gpib address=2 |
VXI-11 | TCPIP::192.168.1.100 | A VXI-11.3 LAN instrument, host=192.168.1.100 (default values for board 0 and LAN device name inst0 are used) |
ZMQ | ZMQ::192.168.20.90::5555 | Use the ZeroMQ messaging library to connect to a device, host=192.168.20.90, port=5555 |
National Instruments also provides examples if you are using PyVISA as the backend.
Interfaces¤
The following interface classes are available
- GPIB — Base class for GPIB communication
- HiSLIP — Base class for the HiSLIP communication protocol
- Prologix — Use Prologix hardware to establish a connection
- SDK — Use the Software Development Kit (SDK) provided by the manufacturer
- Serial — Base class for equipment that is connected through a serial port
- Socket — Base class for equipment that is connected through a socket
- VXI11 — Base class for the VXI-11 communication protocol
- ZeroMQ — Communicate via the ZeroMQ protocol
Backends¤
When a Connection instance is created, the backend
keyword argument decides which backend to use when interfacing with the equipment. There are different Backends to choose from: MSL
(default), PyVISA
or NIDAQ
.
The interface class can be used if the backend
is MSL
. The corresponding interface classes for the external backends are PyVISA and NIDAQ.