pysartoriusb
Project description
pySartoriUSB
USB serial connection to Sartorius Scales
Example:
import pysartoriusb as sub
with sub.SartoriusUsb('COM4') as conn:
result = conn.measure()
assert result.mode == "G"
assert result.value == "+3.4"
assert result.unit == "mg"
assert result.stable == True
assert result.error == False
assert result.calibration == True
Available Commands
There are two methods available to send commands to the scale:
SartoriusUsb.send(cmd)
: just sends a command, results must be read programaticallySartoriusUsb.get(cmd)
: send a command and return the answer from the scale
Since "printing" the current measurement and parsing the result is something
very common, there is a simple method for it: SartoriusUsb.measure()
These commands are available:
-
CMD_PRINT
: "Print" the current measurement result -
CMD_TARA
: performa a tara or set the display to zero -
CMD_EXPCLICIT_TARA
: explicit tara only -
CMD_EXPCLICIT_NULL
: explicit set display to zero -
CMD_INFO_TYPE
: show scale type -
CMD_INFO_SNR
: show serial number of scale -
CMD_INFO_VERSION_SCALE
: show software version of the scale -
CMD_INFO_VERSION_CONTROL_UNIT
: show the software version of the command and display module -
CMD_INFO_USER
: display user and device id -
CMD_FILTER_ENVIRONMENT_VERY_STABLE
: set the filter to "very stable enviroment" -
CMD_FILTER_ENVIRONMENT_STABLE
: set the filter to "stable enviroment" -
CMD_FILTER_ENVIRONMENT_UNSTABLE
: set the filter to "unstable enviroment" -
CMD_FILTER_ENVIRONMENT_VERAY_UNSTABLE
: set the filter to "very unstable enviroment" -
CMD_KEYBOARD_LOCK
: lock the keyboard on the command and display module -
CMD_KEYBOARD_UNKLOCK
: unlock the keyboard on the command and display module -
CMD_KEYPRESS_PRINT
: simulate a keypress on the command modules 'print' key -
CMD_KEYPRESS_CANCEL
: simulate a keypress on the command modules 'cancel' key -
CMD_BEEP
: make the scale beep -
CMD_ADJUST_INTERNAL
: start internal adjustment -
CMD_ADJUST_EXTERNAL
: start external adjustment with standard weights -
CMD_RESTART
: restart the scale
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for SartoriUSB-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9220a587a5ea2f3dca77a34053f17f4240f5b8dad70b9d039c31c5b3595bb0d |
|
MD5 | 2c723db4c8e68daf6dfdaf75c79ef410 |
|
BLAKE2b-256 | 890ebe65f18371412659fb398bcf1cc80414dcc87b0be33dc4b87f4ed9c936b7 |