msl.equipment.connection_pyvisa module
Uses PyVISA as the backend to communicate with the equipment.
- class msl.equipment.connection_pyvisa.ConnectionPyVISA(record)[source]
Bases:
Connection
Uses PyVISA to establish a connection to the equipment.
The
backend
value must be equal toPyVISA
to use this class for the communication system. This is achieved by setting the value in the Backend field for a connection record in the Connections Database to bePyVISA
.Do not instantiate this class directly. Use the
connect()
method to connect to the equipment.- Parameters:
record (
EquipmentRecord
) – A record from an Equipment-Register Database.
- property resource
The PyVISA resource that is used for the connection.
This is the
Resource
that would have been returned if you did the following in a script:import pyvisa rm = pyvisa.ResourceManager() resource = rm.open_resource('ASRL3::INSTR')
- Type:
- static resource_manager(visa_library=None)[source]
Return the PyVISA
ResourceManager
.- Parameters:
visa_library (
VisaLibraryBase
orstr
, optional) –The library to use for PyVISA. For example:
@ivi
to use IVI@ni
to use NI-VISA (only supported in PyVISA <1.11)@py
to use PyVISA-py@sim
to use PyVISA-sim
If
None
thenPyVISA_LIBRARY
will be used.- Returns:
ResourceManager
– The PyVISA Resource Manager.- Raises:
ValueError – If the PyVISA backend wrapper cannot be found.
OSError – If an IVI library cannot be found.
- static resource_class(record)[source]
Get the PyVISA Resource class.
- Parameters:
record (
EquipmentRecord
orConnectionRecord
) – An equipment or connection record from a Database.- Returns:
A
Resource
subclass – The PyVISA Resource class that can open the record.