Simplify liquid handling with a Python API!
Disclaimer: PytomatedLiquidHandling is not supported by Hamilton Company. Please direct all questions to this repo.
See docstrings
- Install 64-bit python >=3.11
- Update pip and install setuptools
- Install git
- Clone this repo to your PC in the HAMILTON/Library folder
- cd into the repo folder and run 'pip install .'
- Start playing with the API
import logging
import os
from PytomatedLiquidHandling.Driver.Hamilton.Backend import MicrolabStarBackend
from PytomatedLiquidHandling.Driver.Hamilton.TemperatureControl import HeaterShaker
from PytomatedLiquidHandling.Driver.Hamilton.Timer import StartTimer
Logger = logging.getLogger("App")
Backend = MicrolabStarBackend(
"Example Star",
os.path.join(os.path.dirname(__file__), "Layout", "Example.lay"),
)
Backend.StartBackend()
# Creates the Backend so we can communicate with the Hamilton
Command = HeaterShaker.Connect.Command(
Options=HeaterShaker.Connect.Options(ComPort=1), BackendErrorHandling=False
)
Backend.ExecuteCommand(Command)
Backend.WaitForResponseBlocking(Command)
Response = Backend.GetResponse(Command, HeaterShaker.Connect.Response)
HeaterShakerHandleId = Response.GetHandleID()
# Connect and get our Handle
DesiredTemperature = 37
Command = HeaterShaker.StartTemperatureControl.Command(
Options=HeaterShaker.StartTemperatureControl.Options(
HandleID=HeaterShakerHandleId, Temperature=DesiredTemperature
),
BackendErrorHandling=False,
)
Backend.ExecuteCommand(Command)
Backend.WaitForResponseBlocking(Command)
Response = Backend.GetResponse(Command, HeaterShaker.StartTemperatureControl.Response)
# Turn on the Heat
#
# NOTE: See Examples/Driver/Hamilton_HeaterShaker.py for the rest!
#
See the Examples folder for more guidance on using the Driver, HAL, and API layers.
Please note that only the Driver layer is 100% functional. This will be updated as HAL and API is finalized.
Thanks to the following for inspiration:
https://github.com/dgretton/pyhamilton