Getting Started with PyHamilton

Oh shoot! Thanks!

Hi!

Iā€™m excited to try Pyhamilton, but I am having some trouble getting started. Iā€™m running this in simulation on my PC to get it working before I try to use it connected to a Hamilton. The script runs, and opens Run control, but it fails while analyzing the method due to ā€œsyntax errors: 0x23 0x2 0x35ā€. Iā€™ve had this error previously, when I was first installing Hamilton and it came down to not having the correct Hamilton libraries installed. In this case, I can see that the library is installed. Has anyone else encountered this issue?

Thank you, any help would be appreciated.

Did you run pyhamilton-configure and proceed with all the executables? One thing you can check is whether you can run a test Venus method that just imports the HTTP library and runs some HTTP functions as a test. If that doesnā€™t work, this is a Venus issue.

Check out the library downloads thread and see if thereā€™s an HTTP installer in there that works. If not, tag one of the Hamilton folks and ask for an updated installer for your combination of Windows and Venus versions.

Thanks for trying PyHamilton! Let me know if thereā€™s anything else I can do to help you get started.

I did start with pyahmilton-configure. As far as I can tell, everything installed.

I will try running a test method to import the HTTP library, thank you!

1 Like

I had to get IT to give me permission to install the library, but I finally did and it worked. Iā€™m so excited to try this out. Now I can finally get started.

Thank you so much!

1 Like

Trying to get PyHamilton to work and whenever I run the default ā€˜robot_method.pyā€™ file that was auto-created, I am getting some JSON errors (ā€˜Class not registeredā€™, ā€˜Bad argumentā€™), but then it repeatedly sends back a ā€˜response status code: 200ā€™ in the trace file and hangs.

Anyone else experience this? How do I move forward from this?
I have made sure that the JSON library was downloaded correctly in the Library folder.
Thanks!

Did you run pyhamilton-configure and accept all the prompts? This is a sign that the JSON library didnā€™t install correctly.

Check out this post with a link to an installer known to fix this issue: Library Downloads? (Requests) - #141 by DanHartman_Hamilton

I did! However, I am running VENUS 6 and getting the updated HSL Json Library from the link you provided fixed my issue. Thank you!

1 Like

Is there a way to programmatically create a deck layout file without using VENUS?

1 Like

Iā€™ve been slowly working on something that allows you to do programmatic deck generation in PyLabRobot and import this into Venus, if itā€™s something youā€™re interested in maybe I can go a little faster lol. You do ultimately have to use Venus though (or use PLR instead).

Hi not sure if this is the correct place for this question. Nor do I know if this question is answered by the docs, I ahve looked and I havent seen anything obvious.

However, how does one use CORE grippers to move plates?
Are their code exampels on how to use these grippers as well as how to use HHS?

i am excited to learn more and would appreciate it if someone can point me to more information.

2 Likes

Check out liquid_handling_wrappers.py

All the ā€œgripperā€ functions are for the CO-RE grippers

def get_plate_gripper_seq(ham, source_plate_seq,  gripHeight, gripWidth, openWidth, lid, tool_sequence, **more_options):
    logging.info('get_plate: Getting plate ' + source_plate_seq )
    
    if lid:
        cid = ham.send_command(GRIP_GET, plateSequence=source_plate_seq, transportMode=1, gripHeight=gripHeight, gripWidth=gripWidth, widthBefore=openWidth, toolSequence=tool_sequence)
    else:
        cid = ham.send_command(GRIP_GET, plateSequence=source_plate_seq, transportMode=0, gripHeight=gripHeight, gripWidth=gripWidth, widthBefore=openWidth, toolSequence=tool_sequence)
    ham.wait_on_response(cid, raise_first_exception=True, timeout=120)

def move_plate_gripper_seq(ham, dest_plate_seq, **more_options):
    logging.info('move_plate: Moving plate ' + dest_plate_seq)
    cid = ham.send_command(GRIP_MOVE, plateSequence=dest_plate_seq)
    ham.wait_on_response(cid, raise_first_exception=True, timeout=120)
    
def place_plate_gripper_seq(ham, dest_plate_seq, tool_sequence, **more_options):
    logging.info('place_plate: Placing plate ' + dest_plate_seq )
    cid = ham.send_command(GRIP_PLACE, plateSequence=dest_plate_seq, toolSequence=tool_sequence)
    ham.wait_on_response(cid, raise_first_exception=True, timeout=120)

def move_plate_gripper(ham, dest_poss, **more_options):
    labware_poss = compound_pos_str(dest_poss)
    #logging.info('move_plate: Moving plate ' + dest_plate_seq)
    cid = ham.send_command(GRIP_MOVE, plateLabwarePositions=labware_poss, **more_options)
    ham.wait_on_response(cid, raise_first_exception=True, timeout=120)
1 Like

Excellent, thanks for your quick response and pointing me in the right direction.

Hi @Stefan
thank you for developing pyHamilton. It looks great and Iā€™m keen to use it but have a number of questions - from general script behaviour to specific equipment integration. Is there any guidance on how to structure questions / where to post them within PyHamilton section?

I feel that some may have already been covered but at the technical level which I struggle to comprehend (e.g. sections Extending the API, references to wrappers etc). Iā€™d imagine the problem is not unique to me :slight_smile: Iā€™m interested in understanding this properly and making a ā€˜dummiesā€™ guide to share with the community and enhance the outreach. Is this something you could support?