msl.equipment.connection_pyvisa module
Uses PyVISA as the backend to communicate with the equipment.
- class msl.equipment.connection_pyvisa.ConnectionPyVISA(record)[source]
Bases:
ConnectionUses PyVISA to establish a connection to the equipment.
The
backendvalue must be equal toPyVISAto 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
Resourcethat 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 (
VisaLibraryBaseorstr, optional) –The library to use for PyVISA. For example:
@ivito use IVI@nito use NI-VISA (only supported in PyVISA <1.11)@pyto use PyVISA-py@simto use PyVISA-sim
If
NonethenPyVISA_LIBRARYwill 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 (
EquipmentRecordorConnectionRecord) – An equipment or connection record from a Database.- Returns:
A
Resourcesubclass – The PyVISA Resource class that can open the record.