Resource Manager

class pyvisa.highlevel.ResourceInfo(interface_type, interface_board_number, resource_class, resource_name, alias)

Resource extended information

Named tuple with information about a resource. Returned by some ResourceManager methods.

Interface_type:Interface type of the given resource string. pyvisa.constants.InterfaceType
Interface_board_number:
 Board number of the interface of the given resource string.
Resource_class:Specifies the resource class (for example, “INSTR”) of the given resource string.
Resource_name:This is the expanded version of the given resource string. The format should be similar to the VISA-defined canonical resource name.
Alias:Specifies the user-defined alias for the given resource string.
class pyvisa.highlevel.ResourceManager[source]

VISA Resource Manager

Parameters:visa_library – VisaLibrary Instance, path of the VISA library or VisaLibrary spec string. (if not given, the default for the platform will be used).
close()[source]

Close the resource manager session.

last_status

Last status code returned for an operation with this Resource Manager

Return type:pyvisa.constants.StatusCode
list_resources(query=u'?*::INSTR')[source]

Returns a tuple of all connected devices matching query.

Parameters:query – regular expression used to match devices.
list_resources_info(query=u'?*::INSTR')[source]

Returns a dictionary mapping resource names to resource extended information of all connected devices matching query.

Parameters:query – regular expression used to match devices.
Returns:Mapping of resource name to ResourceInfo
Return type:dict[str, pyvisa.highlevel.ResourceInfo]
open_bare_resource(resource_name, access_mode=<AccessModes.no_lock: 0>, open_timeout=0)[source]

Open the specified resource without wrapping into a class

Parameters:
  • resource_name – name or alias of the resource to open.
  • access_mode (pyvisa.constants.AccessModes) – access mode.
  • open_timeout – time out to open.
Returns:

Unique logical identifier reference to a session.

open_resource(resource_name, access_mode=<AccessModes.no_lock: 0>, open_timeout=0, **kwargs)[source]

Return an instrument for the resource name.

Parameters:
  • resource_name – name or alias of the resource to open.
  • access_mode (pyvisa.constants.AccessModes) – access mode.
  • open_timeout – time out to open.
  • kwargs – keyword arguments to be used to change instrument attributes after construction.
Return type:

pyvisa.resources.Resource

resource_info(resource_name)[source]

Get the extended information of a particular resource

Parameters:resource_name – Unique symbolic name of a resource.
Return type:pyvisa.highlevel.ResourceInfo
session

Resource Manager session handle.

Raises:pyvisa.errors.InvalidSession if session is closed.