New Era Syringe Pump Library for Python
Project description
NESP-Lib – New Era Syringe Pump Library for Python
This project aims to offer a clean high-level interface to the New Era syringe pumps by New Era Pump Systems.
These pumps are also distributed under different names, like Aladdin by World Precision Instruments (WPI) and LA by Landgraf Laborsysteme.
Features
- Object-oriented design
- Documented public elements via type hints and docstrings
- Signaling errors via exceptions
- Blocking and non-blocking running
- Sending heartbeat messages automatically
Installing
pip install NESP-Lib
Importing
import nesp_lib
Examples
Opening and Closing a Port
Manual Closing
from nesp_lib import Port
# Constructs and opens the port to which the pump is connected.
port = Port('COM1')
# Do something here while the port is open.
...
# Closes the port.
port.close()
Automatic Closing
from nesp_lib import Port
# Constructs, opens and automatically closes the port to which the pump is connected.
with Port('COM1') as port :
# Do something here while the port is open.
...
Configuring a Pump
from nesp_lib import Pump, PumpingDirection
# Constructs the pump connected to the port.
pump = Pump(port)
# Sets the syringe diameter of the pump in units of millimeters.
pump.syringe_diameter = 30.0
# Sets the pumping direction of the pump.
pump.pumping_direction = PumpingDirection.INFUSE
# Sets the pumping volume of the pump in units of milliliters.
pump.pumping_volume = 1.0
# Sets the pumping rate of the pump in units of milliliters per minute.
pump.pumping_rate = 20.0
Identifying a Pump
# Prints the model number of the pump (e.g. "1000" for NE-1000).
print(pump.model_number)
# Prints the firmware version of the pump (e.g. "(3, 928)" for 3.928).
print(pump.firmware_version)
Running a Pump
Blocking
Blocking running waits while the pump is running.
# Runs the pump considering the direction, volume, and rate set.
pump.run()
Non-blocking
Non-blocking running returns immediately after starting the running.
# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)
# Waits while the pump is running.
pump.wait_while_running()
# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)
# Waits while the pump is running.
while pump.running :
# Do something here while the pump is running.
...
# Starts running the pump considering the direction, volume, and rate set.
pump.run(False)
# Do something here while the pump is running.
...
# Stops the pump.
pump.stop()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nesp_lib-1.0.3.tar.gz.
File metadata
- Download URL: nesp_lib-1.0.3.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
554233092946f64d95c53199a1981a6723fd200bf4752398eb36aa8b1321fe9c
|
|
| MD5 |
016b1d3c2b488c50f2b2c75d05aa5875
|
|
| BLAKE2b-256 |
0239d54b49937f999b562e4e659b753530ff58f3404b22dbd9cefeac071bb5b8
|
File details
Details for the file NESP_Lib-1.0.3-py3-none-any.whl.
File metadata
- Download URL: NESP_Lib-1.0.3-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
834f74128f827a0e1e01d0661dda3544157e7b138aeb79855aacf3b3527a6173
|
|
| MD5 |
c5966f1997815bc9b7030c6a7da0f35a
|
|
| BLAKE2b-256 |
c41056470802a5895ab8266efab6d57fdf1626a3b30f728f724a190ee7d8d7f3
|