Hamilton Venus
The Venus device runs your existing Hamilton Venus methods (.hsl files) as steps in an Orca workflow. Orca moves the plates and decides when each Venus method runs. Venus does the pipetting.
Work on the Venus integration is paused. It is not under active development and Cheshire Labs does not offer support for it at this time. Read What works and what does not before you rely on it.
Setup
orca-client runs on the Hamilton PC and runs the Venus methods there. The topology names the device only:
from orca.sdk.devices import Venus
ml_star = Venus("ml_star", site_names=["sample_site", "reagent_site", "tips_site"])
The hook Venus methods go in the device's setup file in the package, devices/ml_star.json:
{
"client": "hamilton_pc",
"real": {
"type": "venus",
"venus": {
"placed_protocol": "Orca\\Placed.hsl",
"picked_protocol": "Orca\\Picked.hsl"
}
}
}
client is the client_id of the orca-client on the Hamilton PC. See orca-client.
Where Venus is installed is a fact about the Hamilton PC, so it goes in that orca-client's own config.json, in the machine block:
{
"machine": {
"venus_exe_path": "C:\\Program Files (x86)\\HAMILTON\\Bin\\HxRun.exe",
"venus_methods_folder": "C:\\Program Files (x86)\\HAMILTON\\Methods"
}
}
The two paths default to the Hamilton install folders shown.
The device starts as sim. Switch it with orca device mode ml_star LIVE when you want Orca to start HxRun.
Venus method paths are relative to the methods folder. A path that leads outside it is refused.
Getting a plate onto the Venus deck
Each name in site_names is one position on the Venus deck that holds one labware. Orca does not model the Venus deck itself. Each site is a location named <location>/<site>, where <location> is the device's key in Topology(locations=...).
A transporter reaches a site through a teachpoint with the same name, for example ml_star/sample_site. A teachpoint named after the device alone (ml_star) reaches every site at one position.
deck_positions sends each of an action's inputs to a named site. An input without an entry goes to any free site:
@orca.action(
device=ml_star,
inputs=[sample_plate, reagent_plate],
deck_positions={sample_plate: "sample_site", reagent_plate: "reagent_site"},
)
The pick and place hook Venus methods
Each pick or place on a Venus site can start a Venus method. You choose which one in four settings:
| Setting | Runs | action value |
|---|---|---|
prepare_place_protocol | before the transporter places a plate on a site | prepare_for_place |
placed_protocol | after the plate is down | notify_placed |
prepare_pick_protocol | before the transporter picks a plate up | prepare_for_pick |
picked_protocol | after the plate is lifted | notify_picked |
A setting left empty runs nothing. init_protocol runs one Venus method when Orca brings the device up, with action set to initialize.
For each hook, Orca starts the Venus method you set and passes it these values:
| Name | Value |
|---|---|
action | Which hook started it (the table above) |
labware_name | The plate's name in Orca |
labware_type | The plate's labware type |
site | The Venus site, such as sample_site |
barcode | The plate's barcode, or an empty string if it has none |
The Venus method runs from start to finish, and Orca waits for it to end before the transporter carries on. Every hook starts the whole Venus method, never a part of it.
How you organize the Venus methods is up to you:
- One Venus method per hook. Set each setting to its own
.hslfile. Each Venus method does one job and can ignoreaction. - One Venus method for several hooks. Set several settings to the same
.hslfile. That Venus method readsactionand uses it to decide what to do. It still runs completely every time, for every hook it is set on.
Every Venus method Orca starts receives action, including one started by run_protocol (run). action is reserved: a value named action passed to run_protocol is replaced with run.
Running a Venus method and passing values
Call run_protocol in an action with the Venus method's path and a dictionary of values. Orca waits for the Venus method to finish before the action ends:
@orca.action(device=ml_star, inputs=[sample_plate], deck_positions={sample_plate: "sample_site"})
async def add_buffer(ctx: ActionContext):
await ctx.device().run_protocol("MyFolder\\AddBuffer.hsl", {"vol": 50, "buffer": "PBS"})
Values can be strings, integers or floats. They go from Orca to Venus only.
Orca starts a Venus method only when its record says the handler's head is empty, because it cannot see the tips the method takes on or off. State the head empty with orca device set-mounted-tips ml_star before the first method after an install, a restart or a reconnect of the handler; see actions.
The Orca submethod library needs two Hamilton libraries that Venus does not include. Install both first:
- HSLJson Library v2.0.1
- ASW Standard v16. HSLJson needs it.
Then add the Orca submethod library to your Venus method. It is in orca-driver-venus, in one folder per instrument:
venus_submethod/mlstar: Microlab STAR and STARlet.venus_submethod/vantage: Vantage.
Use the folder for your instrument. The Vantage version does not load on a STAR or STARlet installation, because that installation has no Vantage library.
In the Venus method:
- Call
ORCA::Initialize(0)at the start of the Venus method. - Read each value by name with
GetConfigProperty_Integer,GetConfigProperty_FloatorGetConfigProperty_String.
To run the Venus method in Venus without Orca, call ORCA::Initialize(1) instead. Each GetConfigProperty_* call then uses its default value. The hook Venus methods read their values the same way.
Tracking volumes and tips
Orca cannot see inside a Venus method. Declare what the Venus method does on the action, and Orca updates its well volumes and tip counts when the action finishes:
from orca.sdk.labware import DeclaredTracking, DeclaredVolumeTransfer
@orca.action(
device=ml_star,
inputs=[reservoir, sample_plate, tips],
deck_positions={reservoir: "reagent_site", sample_plate: "sample_site", tips: "tips_site"},
declares=DeclaredTracking(
volume_transferred=[DeclaredVolumeTransfer(
source="reservoir", target="sample_plate", volume_ul=50.0,
source_wells=["A1", "B1", "C1"], target_wells=["A1", "B1", "C1"])],
tips_used={"tips": ["A1", "B1", "C1"]},
),
)
async def add_buffer(ctx: ActionContext):
await ctx.device().run_protocol("MyFolder\\AddBuffer.hsl", {"vol": 50})
Each source well listed loses volume_ul and each target well listed gains volume_ul. To draw from one well into three, list that source well three times. List the wells explicitly. A transfer without wells is recorded, but no well volumes change. Helpers in orca.sdk.wells, such as columns_96(1, 3), build well lists for whole columns.
When a Venus method fails
Orca does not reliably detect a failed Venus method. Orca decides whether a Venus method succeeded from the exit code of HxRun. In our tests, HxRun exited with code 0 after a successful method, after a runtime error, after an abort, after a syntax error and after a checksum failure. So a Venus method that failed is recorded by Orca as a success: the action completes, the declared volumes and tips are recorded, and the workflow carries on.
Until this is fixed, check the Venus trace file for each run yourself. It is the reliable record of what Venus did. Venus writes it to its LogFiles folder.
If HxRun does exit with a non-zero code, the action fails with HxRun's message, and its declared volumes and tips are not recorded. By default the plate's thread pauses, and you recover it like any other paused action. An action with a different failure policy, such as ABORT, does what that policy says instead. See Recovery.
Nothing comes back from Venus to Orca. Values go from Orca to the Venus method only.
Simulation
A check run never starts HxRun. Orca's own simulator stands in for Venus, and the declared volumes and tips are still recorded.
A SIM run uses the same simulator, on the device's orca-client, and never starts HxRun. So does a LIVE run while the device is set to sim. Running a Venus method in Venus's own simulation mode from Orca is not supported.
What works and what does not
Works today:
- Starting a Venus method from an action with
run_protocol, and waiting for it to end. - Passing string, integer and float values from Orca to the Venus method through the Orca submethod library.
- The pick and place hook Venus methods and
init_protocol. - Recording declared volumes and tips when the action finishes.
- The submethod library on a Microlab STAR or STARlet (
venus_submethod/mlstar) and on a Vantage (venus_submethod/vantage).
Known not to work:
- Detecting a failed Venus method. HxRun exits with code 0 on errors and aborts, and Orca reads only the exit code. See When a Venus method fails.
- Returning a value from a Venus method to Orca.
- Running a Venus method in Venus's own simulation mode from Orca.
Not verified:
- The Venus example in the Orca repository (
examples/simple_venus_example) runs as a check run. Its Venus methods have not been re-run in Venus against the current submethod library. - The HxRun exit-code behaviour above was observed on Venus 6.2 in simulation. Other Venus versions were not tested.
The integration is paused. These gaps are not scheduled.