Metrohm 781

PyLabware driver for Metrohm 781 pH/Ion meter.

class PyLabware.devices.metrohm_781ph.Metrohm781pHMeter(device_name, connection_mode, address, port)[source]

Bases: LabDevice

This provides a Python class for the Metrohm 781 pH/Ion meter based on the original operation manual 8.781.1113 06.2004 / jb.

Default constructor

Parameters:
  • device_name (str) –

  • connection_mode (str) –

  • address (str | None) –

  • port (str | int) –

check_errors()[source]

Gets device errors.

clear_errors()[source]

Not supported on this device.

get_ph()[source]

Gets current viscosity rend.

Return type:

float

get_speed()[source]

Gets current stirring speed.

Return type:

int

get_status()[source]

Gets global device status.

get_temperature()[source]

Gets temperature (secondary measurement in pH mode)

initialize_device()[source]

Set default operation mode & reset.

is_connected()[source]

Check if the device is connected via GET_FW_VER command.

Return type:

bool

is_idle()[source]

Returns True if no measurement is active.

Return type:

bool

set_speed(speed)[source]

Sets desired speed.

Parameters:

speed (int) –

start()[source]

Main method that starts device’s intended activity. E.g if it’s a stirrer, starts stirring. If it’s a stirring hotplate - starts both stirring and heating. For granular control child classes for the devices capable of multiple activities (e.g. stirring hotplate) must implement separate methods defined in the respective derivate abstract classes.

start_stirring()[source]

Starts stirring.

stop()[source]

Stops all device activities and brings it back to idle state. According to the definition of is_idle() above, is_idle() ran after stop() must return True.

stop_stirring()[source]

Stops stirring.

class PyLabware.devices.metrohm_781ph.Metrohm781pHMeterCommands(*args, **kwargs)[source]

Bases: LabDeviceCommands

Collection of command definitions for Metrohm 781 pH/Ion meter.

This class shouldn’t be instantiated

DEFAULT_FW_VER = '5.781.0010'
FW_VER_REGEX = '\\d\\.\\d{3}\\.\\d{4}'
GET_FW_VER = {'name': '&Config.Aux.Prog $Q', 'reply': {'args': ['\\d\\.\\d{3}\\.\\d{4}'], 'parser': <function researcher>, 'type': <class 'str'>}}
GET_PRIMARY_MEAS = {'name': '&Info.ActualInfo.MeasValue.Primary $Q', 'reply': {'args': ['"', '"'], 'parser': <function stripper>, 'type': <class 'float'>}}
GET_SECONDARY_MEAS = {'name': '&Info.ActualInfo.MeasValue.Secondary $Q', 'reply': {'args': ['"', '"'], 'parser': <function stripper>, 'type': <class 'float'>}}
GET_SPEED_SET = {'name': '&Mode.pH.MeasPara.Stirrer.Rate $Q', 'reply': {'args': ['"', '"'], 'parser': <function stripper>, 'type': <class 'int'>}}
GET_STATUS = {'name': '$D', 'reply': {'type': <class 'str'>}}
GET_STIRRER_STATUS = {'name': '&Mode.pH.MeasPara.Stirrer.Status $Q', 'reply': {'args': ['"', '"'], 'parser': <function stripper>, 'type': <class 'str'>}}
GLOBAL_STATUSES = {'$G': 'Running', '$R': 'Idle', '$S': 'Stopped'}
SET_SPEED = {'check': {'values': ['"1"', '"2"', '"3"', '"4"', '"5"', '"6"', '"7"', '"8"', '"9"', '"10"', '"11"', '"12"', '"13"', '"14"', '"15"']}, 'name': '&Mode.pH.MeasPara.Stirrer.Rate', 'type': <class 'str'>}
START_STIR = {'name': '&Mode.pH.MeasPara.Stirrer.Status "ON"'}
STIRRER_STATUSES = {'OFF': False, 'ON': True}
STOP_STIR = {'name': '&Mode.pH.MeasPara.Stirrer.Status "OFF"'}