fluidlab.interfaces

Interfaces with the instruments (fluidlab.interfaces)

Provides some classes:

class fluidlab.interfaces.PhysicalInterfaceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
class fluidlab.interfaces.Interface(**kwargs)[source]
class fluidlab.interfaces.QueryInterface(**kwargs)[source]
class fluidlab.interfaces.FalseInterface(**kwargs)[source]

Dummy interface

Provides some functions:

fluidlab.interfaces.set_default_interface(interface_type, interface_classname)[source]

Select the default class interface for the given interface type. By default, GPIB uses VISAInterface class on Windows (based on NI-VISA) and GPIBInterface class on Linux (based on Linux-GPIB), Ethernet uses SocketInterface class, Seriel uses SerialInterface class.

This means that GPIB instrument can be instantiated as Instrument(‘GPIB0::1::INSTR’) instead of Instrument(VISAInterface(‘GPIB0::1::INSTR’)) or Instrument(GPIBInterface(0,1)), provided the Instrument class defines Instrument.default_physical_interface to PhysicalInterfaceType.GPIB.

The behavior can be changed by this function, i.e. import fluidlab.interfaces as fi fi.set_default_interface(fi.PhysicalInterface.GPIB, ‘VISAInterface’) to force VISAInterface on Linux, or fi.set_default_interface(fi.PhysicalInterface.Ethernet, ‘VISAInterface’) to use VISAInterface class instead of SocketInterface class for network connected devices.

fluidlab.interfaces.interface_from_string(name, default_physical_interface=None, **kwargs)[source]

Infer physical_interface from name if possible, or use the default provided physical_interface otherwise. i.e. if the names contains the physical interface explicitely, then we use it, eg. GPIB0::1::INSTR is GPIB physical interface ASRL0::INSTR is a VISA Serial address 192.168.0.1 is a IP address, so Ethernet interface

Provides some modules:

gpib_inter

Interfaces with GPIB (fluidlab.interfaces.gpib_inter)

modbus_inter

Modbus interfaces (fluidlab.interfaces.modbus_inter)

serial_inter

Interfaces with serial (fluidlab.interfaces.serial_inter)

socket_inter

Interfaces with socket (fluidlab.interfaces.socket_inter)

usbtmc_inter

Interface with Linux USBTMC (fluidlab.interface.usbtmc_inter)

visa_inter

Interfaces with VISA (fluidlab.interfaces.visa_inter)

Functions

interface_classname_from_string(name[, ...])

interface_from_string(name[, ...])

Infer physical_interface from name if possible, or use the default provided physical_interface otherwise.

set_default_interface(interface_type, ...)

Select the default class interface for the given interface type.

Classes

FalseInterface(**kwargs)

Dummy interface

Interface(**kwargs)

PhysicalInterfaceType(value[, names, ...])

QueryInterface(**kwargs)

Exceptions

InterfaceWarning