photons.equipment.dmm module

Base class for a digital multimeter.

class photons.equipment.dmm.Auto(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

For settings that can be in an auto mode (e.g., RANGE, ZERO).

OFF = 'OFF'
ON = 'ON'
ONCE = 'ONCE'
class photons.equipment.dmm.Edge(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

The trigger edge.

RISING = 'RISING'
FALLING = 'FALLING'
BOTH = 'BOTH'
class photons.equipment.dmm.Function(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

The measurement function.

DCV = 'DCV'
DCI = 'DCI'
class photons.equipment.dmm.Mode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

The trigger mode.

IMMEDIATE = 'IMMEDIATE'
BUS = 'BUS'
EXTERNAL = 'EXTERNAL'
class photons.equipment.dmm.Range(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: StrEnum

Function range.

AUTO = 'AUTO'
MINIMUM = 'MINIMUM'
MAXIMUM = 'MAXIMUM'
DEFAULT = 'DEFAULT'
class photons.equipment.dmm.Trigger(**kwargs)[source]

Bases: object

The trigger settings of a DMM.

to_json()[source]
Return type:

dict[str, bool | int | float | str]

class photons.equipment.dmm.Settings(**kwargs)[source]

Bases: object

The configuration settings of a DMM.

to_json()[source]
Return type:

dict[str, int | float | str | dict]

class photons.equipment.dmm.DMM(record, **kwargs)[source]

Bases: BaseEquipment

Base class for a digital multimeter.

Parameters:
  • record (EquipmentRecord) – The equipment record.

  • **kwargs – Keyword arguments. Can be specified as attributes of an XML element in a configuration file (with the tag of the element equal to the alias of record).

class Auto(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

For settings that can be in an auto mode (e.g., RANGE, ZERO).

OFF = 'OFF'
ON = 'ON'
ONCE = 'ONCE'
class Edge(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The trigger edge.

RISING = 'RISING'
FALLING = 'FALLING'
BOTH = 'BOTH'
class Function(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The measurement function.

DCV = 'DCV'
DCI = 'DCI'
class Mode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The trigger mode.

IMMEDIATE = 'IMMEDIATE'
BUS = 'BUS'
EXTERNAL = 'EXTERNAL'
class Range(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Function range.

AUTO = 'AUTO'
MINIMUM = 'MINIMUM'
MAXIMUM = 'MAXIMUM'
DEFAULT = 'DEFAULT'
connection: ConnectionMessageBased
fetched: SignalInstance
settings_changed: SignalInstance
abort()[source]

Abort a measurement in progress.

Return type:

None

acquisition_time(*, settings=None, all_triggers=True, line_freq=50.0)[source]

Get the approximate number of seconds it takes to acquire samples.

Parameters:
  • settings (Settings) – The configuration settings of the digital multimeter.

  • all_triggers (bool) – Whether to include the time to acquire all triggers.

  • line_freq (float) – The line frequency, in Hz.

Return type:

float

check_errors()[source]

Query the error queue.

Raises an exception if there is an error.

Return type:

None

clear()[source]

Clears the event registers in all register groups and the error queue.

Return type:

None

configure(*, function=Function.DCV, range=10, nsamples=10, nplc=10, auto_zero=Auto.ON, trigger=Mode.IMMEDIATE, edge=Edge.FALLING, ntriggers=1, delay=None)[source]

Configure the digital multimeter.

Return type:

Settings

Returns:

The result of settings() after applying the configuration.

fetch(initiate=False)[source]

Fetch the samples.

Parameters:

initiate (bool) – Whether to call initiate() before fetching the data.

Return type:

Samples

initiate()[source]

Put the digital multimeter in the wait-for-trigger state (arm the trigger).

Return type:

None

reset()[source]

Resets the digital multimeter to the factory default state.

Return type:

None

settings()[source]

Returns the configuration settings of the digital multimeter.

Return type:

Settings

trigger()[source]

Send a software trigger.

Return type:

None

zero()[source]

Reset the zero value.

When the multimeter is configured with auto_zero set to OFF, the multimeter may gradually drift out of specification. To minimize the drift, you may call this method to take a new zero measurement.

Return type:

None