Python interface to the SMARTChem-Ion3 ion-selective electrode instrument.
Project description
This is a python interface to the SMARTChem Ion3 ion-selective electrode instrument.
It requires the device to be connected to the host computer using a RS232 style serial port, such as through a USB-to-serial converter, and then provides a basic wrapper around the device’s control capabilities. See the device’s user manual for details on its capabilities.
Source code at https://gitlab.com/ptapping/smartchem-ion3.
Documentation online at https://smartchem-ion3.readthedocs.io/.
Basic Usage
import smartchem_ion3
# Make a function to pretty print data obtained from the device
def handle_data(d):
"""Handle receipt of spontaneous data sent from the instrument."""
print(f"Reading #{d.n} at {d.timestamp.isoformat()}")
print(f" Channel 1, {d.ch1.unit.description} = {d.ch1.value}{d.ch1.unit.suffix}")
print(f" Channel 2, {d.ch2.unit.description} = {d.ch2.value}{d.ch2.unit.suffix}")
print(f" Channel 3, {d.ch3.unit.description} = {d.ch3.value}{d.ch3.unit.suffix}")
print(f" Temperature, {d.cht.unit.description} = {d.cht.value}{d.cht.unit.suffix}")
# With no parameters, will use the first detected serial port at 38400 baud.
ion3 = smartchem_ion3.Ion3()
# Get a reading of the current state of the data channels and print it out
handle_data(ion3.current_data())
# Get the logged data and print them out
for d in ion3.logged_data():
handle_data(d)
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
smartchem_ion3-1.0.0.tar.gz
(21.2 kB
view hashes)
Built Distribution
Close
Hashes for smartchem_ion3-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3e592550dc93dfb57ebfb9ffe40e5037983206fb1deb688433d7d8f054a3162 |
|
MD5 | 207feee10c46e766a1b6ad15c34285d9 |
|
BLAKE2b-256 | d55db95d0ccdb39bc28fe5ae531ef42c8f07c3d44fb861d9f48a254765af9450 |