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 to PyVISA 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 be PyVISA.

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 = visa.ResourceManager()
resource = rm.open_resource('COM6')
Type

Resource

disconnect()[source]

Calls close().

static resource_manager(visa_library=None)[source]

Return the PyVISA ResourceManager.

Parameters

visa_library (VisaLibraryBase or str, optional) –

The library to use for PyVISA. For example:

If None then PyVISA_LIBRARY will be used.

Returns

ResourceManager – The PyVISA Resource Manager.

Raises
static resource_class(record)[source]

Get the PyVISA Resource class.

Parameters

record (EquipmentRecord or ConnectionRecord) – An equipment or connection record from a Database.

Returns

A Resource subclass – The PyVISA Resource class that can open the record.