# Example codes for Hamilton robot experiments

**URL:** <https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223>\
**Category:** General\
**Created:** [June 3, 2025, 5:16pm UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223 "2025-06-03T17:16:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sw23755](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@sw23755](https://discuss.pylabrobot.org/u/sw23755)\
**Post date:** [June 3, 2025, 5:16pm UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223/1 "2025-06-03T17:16:14Z")

</div>

Hello everyone,

I’m using Pylabrobot for Hamilton robot experiments. Compared to the code for visualization, I’ve found that additional elements are needed to run the code on the actual robot. I’m therefore seeking working example codes, both complex or simple, for reference.  
Thanks in advance!

Also available through email: lswnine4 (at) gmail (dot) com

---

<div class="post-metadata">

**Author:** ![rickwierenga](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/rickwierenga/32/963_2.png) [@rickwierenga](https://discuss.pylabrobot.org/u/rickwierenga)\
**Post date:** [June 3, 2025, 5:34pm UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223/2 "2025-06-03T17:34:14Z")

</div>

we don’t really have a library of example protocols (yet), but this quickstart should get you started: [Getting started with liquid handling on a Hamilton STAR(let) — PyLabRobot documentation](https://docs.pylabrobot.org/user_guide/00_liquid-handling/hamilton-star/basic.html)

---

<div class="post-metadata">

**Author:** ![CamilloMoschner](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/camillomoschner/32/7_2.png) [@CamilloMoschner](https://discuss.pylabrobot.org/u/CamilloMoschner)\
**Post date:** [June 4, 2025, 12:01am UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223/3 "2025-06-04T00:01:58Z")

</div>

@sw23755, as Rick mentioned the “PLR Protocol Library” is an ecosystem feature we intend to build over time but haven’t gotten to it yet (but love to see contributions from users who want it).

Are there specific machine operations you want to execute and can share with us?

If we know which Hamilton machine you are using and what you want it to do, we can figure out the command + the parameters you need in this thread 🙂

---

<div class="post-metadata">

**Author:** ![sw23755](https://discuss.pylabrobot.org/letter_avatar_proxy/v4/letter/s/bc79bd/32.png) [@sw23755](https://discuss.pylabrobot.org/u/sw23755)\
**Post date:** [June 6, 2025, 3:29pm UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223/4 "2025-06-06T15:29:20Z")

</div>

Thanks Camillo!  
I am using a Hamilton STAR and am trying to collect as many tested code references as possible (e.g., aspiration, dispensing, using the gripper, and controlling the shaker and heater).

---

<div class="post-metadata">

**Author:** ![CamilloMoschner](https://discuss.pylabrobot.org/user_avatar/discuss.pylabrobot.org/camillomoschner/32/7_2.png) [@CamilloMoschner](https://discuss.pylabrobot.org/u/CamilloMoschner)\
**Post date:** [June 7, 2025, 7:57pm UTC](https://discuss.pylabrobot.org/t/example-codes-for-hamilton-robot-experiments/223/5 "2025-06-07T19:57:32Z")

</div>

@sw23755, I understand the urge to collect code snippets but to be honest, the design space for even a “simple” aspirate command is vast on a Hamilton STAR, based on the firmware that the machine itself accepts … to be precise there are about 44 different arguments you can choose from:

 ![download](https://discuss.pylabrobot.org/uploads/default/original/1X/3de155ee27bb389ddcecac4f1a0bf79b78ac1938.png)  
(a little figure I quickly made to showcase the _machine-intrinsic_ design space for aspiration and dispensation, i.e. this has nothing to do with PLR - PLR just gives us access to all these arguments. Note: some don’t actually make sense, and some don’t work on the firmware level at all: e.g. mixing in the dispense command)

I would therefore recommend to search for specific code snippets based on actions you require:  
e.g.

- \<dispense+mix after\>
- \<dispense in mid air to generate a droplet + move down in z to gently release the droplets on a conductive material\>
- \<aspirate/dispense in multiple z heights without the channel jumping in and out of the wells\> (that will happen due to the firmware defaults for 3 of these arguments 🙃 )
- \<aspirate/dispense with liquid level following\>  
…

But just asking for code snippets without specifying what you are looking for returns a virtually infinite design space 🙂
