Kern KDP3000
PyLabware driver for Kern KDP3000 digital weighting platform (balance).
- class PyLabware.devices.kern_kdp3000.KDP3000Balance(device_name, connection_mode, address=None, port=None)[source]
Bases:
AbstractBalance
This provides a Python class for the Kern KDP3000 balance using KERN KCP protocol version 1.01 based on the operation manual KDP-BA_IA-e-1710 Version 1.0 2017-11 GB
Default constructor
- Parameters:
device_name (str) –
connection_mode (str) –
address (str | None) –
port (str | int | None) –
- calibrate(internal=False)[source]
- Runs the balance calibration according to the manufacturer specifications.
This is an interactive method requiring user to putting on/off the weights for external calibration. The procedure is based on the original user manual page, section 9 “Adjustment”, page 14. The commands listed there differ from the ones in the latest KCP protocol specification!
- Parameters:
internal (bool) – Calibrate using internal weight (if available).
- Returns:
True if calibration has completed successfully.
- Return type:
bool
- get_weight(stable=True)[source]
Gets current weight reading.
- Parameters:
stable (bool, optional) – Whether to wait for the reading to stable. Defaults to True.
- Returns:
current weight reading.
- Return type:
float
- parse_reply(cmd, reply)[source]
Overloaded method from base class. We need to do chop off command echo and status before geting to the actual reply.
- Parameters:
cmd (Dict) –
reply (Any) –
- Return type:
str
- set_tare(stable=True)[source]
Sets tare weight to the currently measured value.
- Parameters:
stable (bool, optional) – Whether to wait for the reading to stable. Defaults to True.
- Return type:
None
- class PyLabware.devices.kern_kdp3000.KDP3000BalanceCommands(*args, **kwargs)[source]
Bases:
LabDeviceCommands
Collection of commands for Kern KDP3000 balance.
This class shouldn’t be instantiated
- CALIBRATE_MAX = {'name': 'JG', 'reply': {'type': <class 'str'>}}
- CALIBRATE_ZERO = {'name': 'JZ', 'reply': {'type': <class 'str'>}}
- CALIBRATION_SAVE = {'name': 'JS', 'reply': {'type': <class 'str'>}}
- DEFAULT_NAME = 'KDP3000'
- ERROR_CODES = {'+': 'Overweight!', '-': 'Underweight!', 'ES': 'Syntax error.', 'I': 'Internal error.', 'L': 'Logical error or invalid parameter.'}
- GET_CMD_LIST = {'name': 'I0', 'reply': {'args': [' '], 'parser': <method 'split' of 'str' objects>, 'type': <class 'str'>}}
- GET_CMD_VER = {'name': 'I1', 'reply': {'args': [' '], 'parser': <method 'split' of 'str' objects>, 'type': <class 'str'>}}
- GET_NAME = {'name': 'I2', 'reply': {'args': [' ', 1], 'parser': <function splitter>, 'type': <class 'str'>}}
- GET_SER_NUM = {'name': 'I4', 'reply': {'args': [' ', 1], 'parser': <function splitter>, 'type': <class 'str'>}}
- GET_SW_ID = {'name': 'I5', 'reply': {'args': [' '], 'parser': <method 'split' of 'str' objects>, 'type': <class 'str'>}}
- GET_SW_VER = {'name': 'I3', 'reply': {'args': [' ', 1], 'parser': <function splitter>, 'type': <class 'str'>}}
- GET_WEIGHT = {'name': 'S', 'reply': {'args': [' '], 'parser': <method 'split' of 'str' objects>, 'type': <class 'float'>}}
- GET_WEIGHT_IMMEDIATE = {'name': 'SI', 'reply': {'args': [' '], 'parser': <method 'split' of 'str' objects>, 'type': <class 'float'>}}
- MAX_WEIGHT = 3000
- RESET = {'name': '@', 'reply': {'type': <class 'str'>}}
- RESPONSE_CODES = {'A': 'Acknowledged.', 'B': 'More data to follow.', 'D': 'Dynamic.', 'S': 'Stable.'}
- SET_TARE = {'name': 'T', 'reply': {'type': <class 'str'>}}
- SET_TARE_IMMEDIATE = {'name': 'TI', 'reply': {'type': <class 'str'>}}
- SET_ZERO = {'name': 'Z', 'reply': {'type': <class 'str'>}}
- SET_ZERO_IMMEDIATE = {'name': 'ZI', 'reply': {'type': <class 'str'>}}