Skip to content

Conversation

BioCam
Copy link
Contributor

@BioCam BioCam commented Jan 25, 2024

I have written code to use the autoload on Hamilton STAR liquid handlers.

I used the iSWAP implementation as inspiration to make this function comprehensive and (in my hands) safe (an autoload or carrier left in the middle of the machine has the potential to damage the machine, users operate on their own responsibility):

  1. Check whether autoload is installed during setup. (I couldn't find a specific cue of the machine or direct command that checks this (this could be because autoloads cannot be retrofitted into Hamilton liquid handlers, and therefore no need for checking would VENUS-normally arise). So instead I am using the I0RO fw command ("Request download date") to check when the autoload software has been downloaded. If the download has happened after 2015 the machine is considered to have an autoload installed. I will have to receive feedback from other users who do not have an autoload whether this truly recognises the absence of the autoload - similar to how the absence of an iSWAP had to be figured out by a user without an iSWAP :)
  2. If an autoload is installed, a check whether the autoload is initialised will be performed.
  3. If not initialised, the autoload will initialise.
  4. Initialisation leaves the autoload hanging on the wrong end of the robot (i.e. crash danger). Hence, I implemented a "park_autoload" function. However, I couldn't find a direct fw command to simply move the autoload out of the way yet. So instead the fw command C0CS ("Check for presence of carriers on loading tray") acts as an intermediate solution because it ends with the autoload parked in a save position.

This enables loading of carriers:

await STAR.load_carrier(tip_carrier_0)

This enables unloading of carriers:

await STAR.unload_carrier(tip_carrier_0)

Furthermore, the fw command for loading is the main way of quickly identifying the barcodes of your labware.
This is activated using...

await STAR.load_carrier(tip_carrier_0, barcode_reading=True)

This function can currently specify further:

barcode_reading_direction: str = 'horizontal',
barcode_symbology: str = 'Code 128 (Subset B and C)',
no_container_per_carrier: int = 5,
park_autoload_after: bool = True

I have verified the ability to read barcodes from Hamilton tip carriers and Hamilton tips.

Plate barcodes cannot be read yet.

After closing this PR I will write a forum post detailing the functionalities for easy adaptation by other users.

Copy link
Member

@rickwierenga rickwierenga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're on fire!

@BioCam
Copy link
Contributor Author

BioCam commented Jan 26, 2024

I have rewritten the original version to

  1. Actually check whether an autoload is installed directly
  2. Exposed a true park_autoload that identifies the number of tracks/positions available (differs between STAR & STARlet) and when called sends the autoload to the last track where it is safely out of the way.

However, one of the unit tests suddenly fails and I am not yet sure why:

=================================== FAILURES ===================================
___________________ LiquidHandlingApiGeneralTests.test_stop ____________________

self = <liquid_handling_api_tests.LiquidHandlingApiGeneralTests testMethod=test_stop>

    def test_stop(self):
      with self.app.test_client() as client:
        response = client.post(self.base_url + "/stop")
        self.assertEqual(response.status_code, 200)
>       self.assertIn(response.json.get("status"), {"running", "succeeded"})
E       AssertionError: 'error' not found in {'running', 'succeeded'}

pylabrobot/server/liquid_handling_api_tests.py:64: AssertionError

@rickwierenga
Copy link
Member

Awesome. I'll look at the code very soon.

Regarding the test: this is some kind of race condition that sometimes occurs. I have to debug that, but haven't found the time yet. It's fine to ignore for now.

@rickwierenga rickwierenga merged commit e40349f into PyLabRobot:main Jan 30, 2024
rickwierenga added a commit that referenced this pull request Nov 13, 2024
Exposing autoload carrier load, unload & barcode reading (v1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants