-
Notifications
You must be signed in to change notification settings - Fork 127
Nimbus Integration: TCP Backend and Interface Introspection #740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
cmoscy
commented
Nov 4, 2025
- Added TCP I/O protocol with the Hamilton specific TCPBackend supporting Nimbus (and possibly Prep) specific communication and introspection through their IP->Harp2->Hoi2 protocol.
- Currently includes basics of instrument connection, introspection.
- Can use HamiltonCommand to construct message to run instrument commands while managing any responses received from the instrument.
…ugh Hamilton .NET firmware interface. TCP connection works through proxy to log direct communication.
- Added tcp_comlink_proxy for setup of Nimbus Comlink instance. Manages TCP communication through .NET firmware libraries - Removed setup.py in favor of pyproject.toml for package management. - Updated pyproject.toml with project metadata, dependencies, and optional dependencies.
- Updated `README.md` to include instructions for using the test notebook and requirements for DLL dependencies. - Introduced `dll_comlink_test.ipynb` to demonstrate TCP communication with Hamilton Nimbus instruments, including connection setup, module discovery, and pipettor operations. - Added `nimbus-connect-validation.json` as logging and validating TCP communication example - Fixed `firmware_assemblies.py` to load required Hamilton.Components.TransportLayer.Protocols.dll
…port - Introduced `tcp_codec.py` for Hamilton protocol communication, implementing a three-layer packet structure (IpPacket, Harp2, Hoi2) and associated message builders for command execution.
- Introduced a new Hamilton TCP backend with connection management, message routing, and command execution capabilities. - Implemented a layered architecture for the Hamilton protocol, including packet structures (IpPacket, HarpPacket, HoiPacket) and message builders (CommandMessage, InitMessage). - HoiParams for automatic DataFragment wrapping in command parameters.
- Added HamiltonIntrospection class for dynamic discovery of instrument capabilities (Thanks Piglet for showing that pattern). - Implemented commands for retrieving object interfaces, metadata, method signatures, enums, and structs. - Example in nimbus_connection_test.ipynb demonstrates finding an interface (Doorlock in this case), and then constructing the corresponding commands to check status, lock, unlock, etc.
1. Improved HoiParameter handling for more efficient use 2. Updated nimbus_connection_test.ipynb to show pipettor introspection, and initialization + park execution 3. Restored original project setup.py and pyproject files for consistency. 4. Moved all DLL related features to separate branch
|
My fault with the typing/linting. Cleaning this up and will update shortly |
|
it's fine to do those things last for linting but otherwise don't bother making tests pass every revision, it's more about content than style at this point |
|
do you think it would be possible to load some commands like aspirate and dispense and implement them in python in PLR? |
|
Got it! Was pretty minor to get it to pass. That's definitely possible! Primary bottleneck for me has been handling that Nimbus has several deck/waste block configurations. Pretty sure there's a way to detect a lot of this so there's no potentially dangerous assumptions made. Could add basic instrument control into a NimbusBackend pretty easily in the next 1-2 days (User would have to specify coordinates themselves until we get a deck layout defined). Tip pickup, drop, aspirate, dispense, initialization, and door control seem like a good minimal implementation? Anything else that would be worth prioritizing? |
|
those "big four" + setup are the most important, everything else is nice to have. appreciate it! for the stars the user has to specify some things about their deck layout, like where the core grippers are if they have them. after that it's just modeled through the universal resource model. we could have a similar thing for the nimbus deck = NimbusDeck(
trash_pos = "option a"
) |
…ecodes and displays command args and return values into their corresponding types.
|
Sounds good, thanks for the example. Checkpointed the cleanup and improved the introspection to help me put all that together next! |
…ls for testing. Example notebook with NimbusBackend Examples. ! Corrected message parsing for array types in HoiParamsParser.
- Added NimbusTipType enumeration for mapping tip types to Hamilton protocol commands. - Implemented InitializeSmartRoll, SetChannelConfiguration, PickupTips, DropTips, and DropTipsRoll commands for Nimbus backend. - Updated NimbusBackend setup process to include channel configuration and tip presence checks. - Enhanced NimbusDeck to create default long waste block and associated waste positions. - Improved error handling and logging for tip pickup and drop operations.
Right? PickupGripperTool also lacks a zFinal in the signature. Weird since most other operations have it. But double checked the extracted interface methods and their firmware documentation. They both don't include zFinal. Pipettor Interface Methods from introspection layer for reference. |
| # flow_rate should not be None - if it is, it's an error (no hardcoded fallback) | ||
| flow_rates: List[float] = [] | ||
| for op in ops: | ||
| if op.flow_rate is None: | ||
| raise ValueError(f"flow_rate cannot be None for operation {op}") | ||
| flow_rates.append(op.flow_rate) | ||
| blowout_volumes = [ | ||
| op.blow_out_air_volume if op.blow_out_air_volume is not None else 40.0 for op in ops | ||
| ] # in uL, default 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means the user has to specify flow rates, which isn't the case for other liquid handlers in PLR. they will often want to, but maybe not always (eg for simple prototyping)
what is the default value nimbus uses if anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1000 ul tip: 250 asp / 400 disp
300 and 50 ul tip: 100 asp / 180 disp
10 ul tip: 100 asp / 75 disp
|
what is the difference between HoiPacket and HoiResponse? |
HoiPacket is the lower level wire protocol, handles low level encoding/decoding. HoiResponse in the interpreter layer that translates enums, action codes, etc that map to hamilton responses/behaviors. |
It seems they contain the same information? parse_message checks the action for error, but then in the success case copies information over into a and it's pretty similar in the error case. in is there a reason I shouldn't merge them into one? (delete |
Would be fine with me. I originally kept them separate to stay aligned with Hamilton’s .NET structure — it made it easier to test against the firmware DLLs. Now that we've captured most of it, probably less important to be a 1:1 mirror. |
Unfortunately the spacing between channels is a little odd here: This means we can't use Since I have already decided I want to move having decks define a tip position for every tip spot and having discard use these, it is fine to keep it in this pattern for the nimbus (the new pattern that other backends will also use soon) rather than figuring these things out right now. |
|
@cmoscy could you please make sure the code still works as expected? then it will be ready to merge. |
|
I am merging the binary parser (https://github.com/PyLabRobot/pylabrobot/pull/740/changes#diff-8e70176e729f055fd4aae4c482c93135752ce382647b1d60f2084a3194c6c902) separately right now so I can use it the tecan infinite PR while finish this up |
Will take a look tonight |
Right on, you reminded me of that little detail on the Nimbus. Funny enough those are the default tip waste positions from their deck definition. Think it avoids the teaching positions in case you don't place the little metal piece that is suposed to cover them when not being actively used on their default long waste. |
|
That makes sense. Also, I made a forum post to discuss making this behavior the default: https://discuss.pylabrobot.org/t/per-channel-tip-discard-positions-on-deck-instead-of-computed-offsets/420 because it is more flexible and generally nicer |
…arameters Drop operations now use fixed offsets (10mm) instead of tip length, matching VantageBackend. Fixes regression from 8f2775c.
|
Couple regressions, but nothing too bad. I like the consolidation you implemented, will do a little smoothing tomorrow evening. Shouldn't take long. |