Reverse Engineering the Hall

Lab World / instrument integration / Di Hu

Reverse engineering the hall

9 stations. For each one: is it already decoded, how does software reach it, and what does a first run look like.

Every run on this page is a simulation. Nothing here ran on a physical instrument. Built against the public PyLabRobot source at commit 182f92e of 23 Nov 2026.

TODO_1, TODO_2 and so on are placeholders used on purpose: each marks a payload not yet decoded or a fact about the real instrument not yet known.

Watch each station run in simulation

The method is the same at every station

  1. Ask first: is it already decoded? Read the PyLabRobot device registry and source before touching the instrument. 3 of these 9 stations already are.
  2. If the maker publishes an interface, use it. An SDK means there is nothing to decode. Write 1 small class around it.
  3. If not, extract, don't guess. Capture the maker's own software doing 1 action at a time. Get the wire format exact: transport, framing, checksum, handshake.
  4. Write 1 plain class. Its public methods state intent and are safe to repeat: read the state, act only if needed, confirm.
  5. Prove it without the instrument. Replay the traffic against the class. Errors keep their code. An unverified driver says so when it starts.
  6. The first live command only reads. Then 1 move with empty labware and a person present.

Steps 3 to 5 follow the PyLabRobot device driver guide. Steps 3 and 6 follow my reverse engineering playbook.

StationWhere it standsHow software reaches it In simulation
Tissue-culture stationInstrument not chosen yetNot decided. The example uses a made-up stand-in: 1 JSON message per release, the adapter speaks first, the station acknowledges or refuses. A real adapter would wrap what the chosen supplier documents.5 passed
Agilent BioTek EL406Decoded, in PyLabRobotFTDI USB, 38400 baud 8N2, no flow control. Host speaks first: 11-byte header (cmd, length, checksum), payload (protocol.py:15-25). Reply: ACK 0x06, header, data (el406.py:318-319). Steps polled by 0x92 (el406.py:595).4 passed
Hamilton Microlab STARDecoded, in PyLabRobotUSB, VID 0x08AF, PID 0x8000 (master.py:81-82). The host speaks first: ASCII commands like C0TPid0117xp... Each reply repeats module, command and id, then er00/00 or an error code (framing.py:3-5 and framing.py:319-320).6 passed
LiCONiC STX44 incubatorDecoded, in PyLabRobot, older interfaceRS-232, 9600 baud 8E1, RTS/CTS (liconic_backend.py:80-90). Host speaks first: a break, CR answered by CC, then 1 ASCII command per line (ST, RS, RD, WR DMn) ending in CR; replies end CR LF (liconic_backend.py:96-139).4 passed
Rail-mounted transfer arm (linear track)Maker's SDK, nothing to decodeThrough the xArm controller with xarm-python-sdk: the same XArmAPI object as the arm calls get/set_linear_motor_*; the SDK sends them as Modbus to the control box RS-485 (xarm-python-sdk xarm/x3/linear_motor.py:40-46).6 passed
UFACTORY xArm 6 plate armMaker's SDK, nothing to decodeEthernet to the xArm controller through xarm-python-sdk (hello-world.ipynb:12). XArmAPI(ip) is created in setup(), then each operation is 1 blocking SDK call run in a thread (xarm6.py:86).7 passed
Passive plate hotelNothing to decodeNothing to reach: no wire. Software keeps a model of what sits on each shelf (PyLabRobot resources) and the arm that loads it is the only actor. The scheduler owns reservations and timers.5 passed
BMG LABTECH PHERAstar FSXNot decoded yetUnknown. Upstream's 2 BMG readers share 1 framing module: the CLARIOstar speaks FTDI frames (STX, size, header, payload, 24-bit sum, CR) or USB packets, the VANTAstar USB only. The host asks, then polls status.7 passed
Shared LC-MS benchNothing to decodeRear remote connector: software reads a Ready line and closes a Start contact through opto-isolators (README.md:88-97). The vendor software holds the method. Raw files are picked up from a data folder.5 passed

Station 1 of 9 / Instrument not chosen yet

Tissue-culture station

Supplier and interface are still open, so there is no protocol to show yet.

How software reaches it
Not decided. The example uses a made-up stand-in: 1 JSON message per release, the adapter speaks first, the station acknowledges or refuses. A real adapter would wrap what the chosen supplier documents.
Where the commands came from
Nothing decoded and nothing to decode yet. The message format, the error name unknown_batch and the ids are invented for this stand-in (TODO_1: the real interface). The questions below come from the toolkit's APPROACH.md and PREFLIGHT.md.

Decide it

  1. Does it have an external serial, USB or Ethernet port, so a teardown can be skipped? (APPROACH.md:19-20)
  2. Does the vendor PC app drive it over a link you can mirror and capture, 1 setpoint at a time? (APPROACH.md:71-82)
  3. Is there a Ready, Start and Stop remote connector you could use as a minimal first tier? (APPROACH.md:22-43)
  4. Which commands are read-only telemetry and which actuate, so you can arm them separately? (APPROACH.md:3-6 and APPROACH.md:45-51)
  5. Can your software be the sole master with the vendor app closed? (APPROACH.md:92-93)
  6. Which limits and interlocks stay on the instrument, and can you stay out of its internals? (APPROACH.md:5-6 and PREFLIGHT.md:7-8)

The example

Release 1 cell batch for seeding and check that the receiving worklist names that batch in every row. Batch and worklist ids are made up.

adapter = CultureAdapter(station)
worklist = [{"plate": "seed_plate_1", "well": w, "batch": "CB-0001"}
            for w in ("A1", "A2", "A3")]
log("ask   release CB-0001 for seeding against worklist WL-7")
try:
  adapter.release("CB-0001", "WL-7", worklist)
except ReleaseNotConfirmed as e:
  out.update(outcome="hold", evidence=str(e))
except ReleaseRefused as e:
  out.update(outcome="error", evidence=str(e))
else:
  out.update(outcome="completed", evidence="CB-0001 released, worklist WL-7 matches")
What ran in simulation / 5 tests passed
ask   release CB-0001 for seeding against worklist WL-7
send  {"op": "release", "batch": "CB-0001", "worklist": "WL-7"}
recv  {"ok": true, "batch": "CB-0001"}
state released {'CB-0001': 'WL-7'}, executed 1
done  completed: CB-0001 released, worklist WL-7 matches
What is real, what is simulated, and the limits found in the source

Real

  • Nothing from an instrument: no supplier is chosen

Simulated

  • The station, its known batches and its releases
  • The stand-in message format and its replies

Not checked

  • Any culture instrument or its interface
  • Whether a real station acknowledges releases at all

Limits found in the source

  • lost_reply maps to a release sent with no acknowledgement: hold, never resend (stations/culture/drive.py:37-39).
  • device_error maps to the stand-in refusing the release with a made-up error name, unknown_batch (stations/culture/sim.py:37-38).
  • Nothing in PyLabRobot 182f92e is used here; the adapter is this example's own code.

Sources / PREFLIGHT.md / APPROACH.md

Station 2 of 9 / Decoded, in PyLabRobot

Agilent BioTek EL406

In PyLabRobot, v1 class EL406, registry status mostly (devices.json:120-122). Binary frames over FTDI USB.

How software reaches it
FTDI USB, 38400 baud 8N2, no flow control. Host speaks first: 11-byte header (cmd, length, checksum), payload (protocol.py:15-25). Reply: ACK 0x06, header, data (el406.py:318-319). Steps polled by 0x92 (el406.py:595).
Where the commands came from
The v1 code names no source for the protocol. Legacy wash tests check bytes against reference captures from real EL406 hardware (steps_wash_tests.py:570-571). Some limits are labelled as the vendor GUI's (peristaltic_dispenser.py:176 and el406.py:1015-1018).

Drive the real one

  1. Connect the EL406 by USB. setup() opens it as an FTDI device at 38400 baud 8N2, no flow control (el406.py:147-157).
  2. Create EL406(name="el406", device_id=<FTDI serial>); the FTDI layer refuses to pick when several devices match (ftdi.py:601-606 and el406.py:84).
  3. await el406.setup(): it sends TEST_COMM 0x73, INIT_STATE 0xA0, then a full RESET 0x70 unless skip_reset=True (el406.py:178-186 and el406.py:290-303).
  4. el406.set_plate(plate) with the PLR plate really loaded: 96, 384 or 1536 wells only (el406.py:113-119 and helpers.py:67-74).
  5. In async with el406.batch(): peristaltic_dispenser.prime(volume=...), .dispense(volumes={col: uL}) (peristaltic_dispenser.py:83-94 and peristaltic_dispenser.py:139-145).
  6. await el406.stop(). Check the wells by eye and file the upstream device test report (needs-testing.md:31-35).

The example

Seed cells into a 384-well plate: set up, open a batch, prime the peristaltic lines with 500 uL, dispense 40 uL into every well (24 columns), close the batch. Made-up round volumes.

el406 = EL406(name="el406")
el406.io = sim  # the only swap: the FTDI transport becomes the simulator
tap.ask("set up: FTDI 38400 8N2, TEST_COMM, INIT_STATE, RESET")
await el406.setup()

plate = cellvis_384_wellplate_120uL_Fb(name="cells_384")
el406.set_plate(plate)
tap.ask("open a batch for the 384-well plate")
async with el406.batch():
  tap.ask("prime the peristaltic lines, 500 uL")
  await el406.peristaltic_dispenser.prime(volume=500)

  tap.ask("dispense 40 uL per well, columns 1-24")
  volumes = {column: 40 for column in range(1, 25)}  # uL per well, by column
  await el406.peristaltic_dispenser.dispense(volumes=volumes)
  tap.ask("close the batch: home motors, end-of-batch marker")
await el406.stop()
What ran in simulation / 4 tests passed
ask   set up: FTDI 38400 8N2, TEST_COMM, INIT_STATE, RESET
send  3 frames, by command: TEST_COMM INIT_STATE RESET
recv  3 replies, last: 06 01 02 70 00 01 00 00 00 00 8c ff
state plate -, batch closed, prime 0 uL, 0 cols at [] uL, err 0x0000
ask   open a batch for the 384-well plate
send  7 frames, by command: 0x00bf 0x00c1 0x00f2 0x00f4 0x0154 0x0102 0x010a
send  01 02 8d 00 01 00 00 01 00 6d ff 01
recv  8 replies, last: 06 01 02 8d 00 01 00 00 00 00 6f ff
state plate 384 std, batch open, prime 0 uL, 0 cols at [] uL, err 0x0000
ask   prime the peristaltic lines, 500 uL
send  1 frames, by command: STATUS_POLL
send  01 02 90 00 01 00 00 0b 00 67 fe 01 f4 01 00 00 02 01 00 01 00 00
send  2 frames, by command: STATUS_POLL STATUS_POLL
recv  4 replies, last: 06 01 02 92 00 01 00 00 09 00 60 ff 00 00 01 00 00 00 00 00 00
state plate 384 std, batch open, prime 500 uL, 0 cols at [] uL, err 0x0000
ask   dispense 40 uL per well, columns 1-24
send  1 frames, by command: STATUS_POLL
send  01 02 8f 00 01 00 00 18 00 d2 fb 01 28 00 02 00 00 00 4d 01 0a 00 02 ff ff ff 00 00...
send  2 frames, by command: STATUS_POLL STATUS_POLL
recv  4 replies, last: 06 01 02 92 00 01 00 00 09 00 60 ff 00 00 01 00 00 00 00 00 00
state plate 384 std, batch open, prime 500 uL, 24 cols at [40] uL, err 0x0000
ask   close the batch: home motors, end-of-batch marker
send  2 frames, by command: HOME_MOTORS END_OF_BATCH
recv  2 replies, last: 06 01 02 8c 00 01 00 00 00 00 70 ff
state plate 384 std, batch closed, prime 500 uL, 24 cols at [40] uL, err 0x0000
done  completed: sim: 24/24 columns at 40 uL/well, peristaltic pump, plate byte 1 (384 std)
What is real, what is simulated, and the limits found in the source

Real

  • Upstream EL406 class and its peristaltic dispenser, unchanged
  • Every frame byte the driver writes, incl. the 0x8F dispense frame
  • Error code table and message for 0x1355

Simulated

  • The EL406: frame and checksum decoding, replies, poll states
  • Device state: plate type, prime volume, uL per column, steps
  • Faults: dropped dispense reply; error 0x1355 in place of the dispense

Not checked

  • Any physical EL406; nothing here ran on hardware
  • Real reply header bytes beyond length and command echo (TODO_1)
  • Real busy time and post-fault state of a step (TODO_2)

Limits found in the source

  • No tests for the v1 class: pylabrobot/agilent/biotek/el406/ has no *_tests.py; wire tests are legacy only, with a canned MockFTDI (mock_tests.py:72).
  • Replies are not checked: the driver reads only the length at header bytes 7-8 and ignores markers and checksum (el406.py:364-371).
  • batch() first sends 7 unnamed commands (0xBF ... 0x010A) and only logs a warning if they fail (el406.py:724-731).
  • Docstrings say the plate comes from the plate_holder (el406.py:682 and el406.py:1021), but only set_plate() sets it (el406.py:113-119).

Sources / el406.py at 182f92e / protocol.py (framing, checksum) / peristaltic_dispenser.py / devices.json registry entry / Legacy wash tests (reference captures)

Station 3 of 9 / Decoded, in PyLabRobot

Hamilton Microlab STAR

In PyLabRobot. The real STARDriver sends text firmware commands over USB.

How software reaches it
USB, VID 0x08AF, PID 0x8000 (master.py:81-82). The host speaks first: ASCII commands like C0TPid0117xp... Each reply repeats module, command and id, then er00/00 or an error code (framing.py:3-5 and framing.py:319-320).
Where the commands came from
Upstream does not say how the commands were first obtained. Its code cites the firmware docs (framing.py:38), marks some codes as observed, not documented (errors.py:349), and its debug page compares PLR commands with VENUS USB trace files (debug.md:7-11).

Drive the real one

  1. With Python 3.10 or newer, in a virtual environment: pip install "pylabrobot[usb]", which adds pyusb and libusb-package (installation.md:3 and installation.md:47).
  2. Connect the STAR by its USB cable. On macOS also install libusb (brew install libusb); on Linux the docs list nothing more (installation.md:90-100).
  3. On Windows, with no Hamilton or VENUS software running, use Zadig to give "ML Star" the libusbK driver; restore the original driver for VENUS (installation.md:108-144).
  4. STARDriver() with no io opens the USB device itself, VID 0x08AF, PID 0x8000 (master.py:145-152).
  5. Build the deck as it stands, then star = STARlet(deck=deck) or STAR(deck=deck). Setup refuses a deck whose track count differs from the device's (master.py:1155-1171).
  6. await star.setup() reads the device, then initializes it, so it moves (master.py:214). Then a first small step, such as picking up tips.

The example

Start-up conversation, then pick up 8 tips, aspirate 50 uL from column 1 of a source plate, dispense into column 1 of a destination plate, return the tips. Volumes made up.

def build(link):
  deck = STARLetDeck()
  tip_car = hamilton_tip_carrier_L5(name="tip_carrier")
  tip_car[0] = tips = hamilton_96_tiprack_300uL(name="tips")
  deck.assign_child_resource(tip_car, track=1)
  plt_car = hamilton_plate_carrier_L5_ac(name="plate_carrier")
  plt_car[0] = source = cor_96_wellplate_360uL_Fb(name="source")
  plt_car[1] = dest = cor_96_wellplate_360uL_Fb(name="destination")
  deck.assign_child_resource(plt_car, track=8)
  # On hardware: STARDriver() with no io opens the USB device itself.
  star = STARlet(deck=deck, driver=STARDriver(io=link))
  return star, tips, source, dest


async def sample_prep(star, tips, source, dest):
  await star.setup()
  await star.pipettes.pick_up_tips(tips["A1:H1"])
  await star.pipettes.aspirate(source["A1:H1"], [50.0] * 8)
  await star.pipettes.dispense(dest["A1:H1"], [50.0] * 8)
  await star.pipettes.return_tips()
What ran in simulation / 6 tests passed
ask   set up; 8 tips; 50 uL from source col 1 to destination col 1; return tips
send  C0RMid0001
recv  C0RMid0001er00/00kb01kp08
send  C0VIid0034
recv  C0VIid0034er00/00
send  C0DIid0036xp08000&yp4050 3783 3516 3249 2982 2715 2448 2181tp2450tz1220te3600tm1 1 1 1 1 1 ...
recv  C0DIid0036er00/00
send  C0TPid0117xp01179 01179 01179 01179 01179 01179 01179 01179yp1458 1368 1278 1188 1098 1008 ...
state tips on 8 of 8 channels
recv  C0TPid0117er00/00
send  C0ASid0176at0 0 0 0 0 0 0 0tm1 1 1 1 1 1 1 1xp02758 02758 02758 02758 02758 02758 02758 027...
state left in source wells: [44.9] uL each; tips hold [55.1] uL each
recv  C0ASid0176er00/00
send  C0DSid0227dm2 2 2 2 2 2 2 2tm1 1 1 1 1 1 1 1xp02758 02758 02758 02758 02758 02758 02758 027...
state now in destination wells: [55.1] uL each; tips hold [0.0] uL each
recv  C0DSid0227er00/00
send  C0TRid0238xp01179 01179 01179 01179 01179 01179 01179 01179yp1458 1368 1278 1188 1098 1008 ...
state tips on 0 of 8 channels, 96 in the rack
recv  C0TRid0238er00/00
done  completed: destination col 1: [55.1] uL each (50 uL asked + liquid class); 96 tips in rack
What is real, what is simulated, and the limits found in the source

Real

  • pylabrobot STARDriver, STARlet device and Pipettes feature, unchanged
  • Every frame the driver wrote: 274 commands; the log shows 7 kinds
  • Upstream liquid class: 50 uL asked goes out as av00551, 55.1 uL

Simulated

  • The USB transport, every reply and the reply router's clock (sim.py)
  • Device state: tips per channel, liquid per tip, volume per well
  • A cut-down STARlet: 8 channels, no iSWAP, 96-head or autoload

Not checked

  • Nothing ran on a physical STAR
  • Reply values and padding beyond the upstream recording and test captures
  • Timing, motion, real liquid behaviour and real error codes for this move

Limits found in the source

  • The device registry still points STAR at the legacy STARBackend, api v0 (devices.json:539-540).
  • Only the STAR recording was read off a device; the STARlet and STARplus ones are derived (README.md:5-7 and README.md:47).
  • 50 uL becomes 55.1 uL: the 400 uL tip maps to the 300 uL water class StandardVolume_Water_DispenseSurface_Part, curve 50.0: 55.1 (mapping.py:46 and mapping.py:14004-14010).
  • Upstream's own STARSimulationDriver answers above the wire: nothing reaches it (simulator.py:8), so wire replies here are this example's.

Sources / Installation and USB interface / Debugging STAR issues (VENUS trace files) / STAR design notes / STAR recordings README / Device registry / STARDriver (master.py) / Reply framing / Legacy STAR tests (captured replies) / STAR liquid classes (mapping.py)

Station 4 of 9 / Decoded, in PyLabRobot, older interface

LiCONiC STX44 incubator

In PyLabRobot legacy only (v0); STX44_IC is a listed model (constants.py:5). ASCII over RS-232.

How software reaches it
RS-232, 9600 baud 8E1, RTS/CTS (liconic_backend.py:80-90). Host speaks first: a break, CR answered by CC, then 1 ASCII command per line (ST, RS, RD, WR DMn) ending in CR; replies end CR LF (liconic_backend.py:96-139).
Where the commands came from
Upstream points to LiCONiC documentation: tests check 2 reference points from the Liconic documentation (liconic_backend_tests.py:52-55), and a TODO says a shaker command must still be found there (liconic_backend.py:369). Many methods are marked UNTESTED (liconic_backend.py:365-554).

Drive the real one

  1. Connect the STX PLC by RS-232. The backend opens it at 9600 baud 8E1 with RTS/CTS (liconic_backend.py:80-90).
  2. Create ExperimentalLiconicBackend(model="STX44_IC", port="/dev/ttyUSB0"); models are listed in constants.py:5-63.
  3. Build Incubator(backend, racks=[...], ...) with liconic_rack_* racks matching the cassettes; cassette numbers follow the rack order (liconic_backend.py:141-147).
  4. await stx.setup(): break, CR -> CC, ST 1801 -> OK, then RD 1915 until 1 (liconic_backend.py:96-139).
  5. Put the plate on stx.loading_tray, then take_in_plate(site), fetch_plate_to_loading_tray(name), get_temperature() (incubator.py:111 and incubator.py:151-177).
  6. Watch the shovel by eye on the first runs and file the upstream device test report (needs-testing.md:31-35).

The example

Take 1 plate from the transfer station into cassette 1, position 1, fetch it back out to the transfer station, then read the temperature. Made-up slot and a made-up 37.0 deg C.

backend = ExperimentalLiconicBackend(model="STX44_IC", port="/dev/ttyUSB0")
backend.io = sim  # the only swap: the Serial transport becomes the simulator
rack = liconic_rack_17mm_22(name="cassette_1")  # 22 positions, 23 mm pitch
stx = Incubator(backend=backend, name="stx44", size_x=600, size_y=600, size_z=700,
                racks=[rack], loading_tray_location=Coordinate(0, 0, 0))
tap.ask("set up: break, CR handshake, activate handling, wait ready")
await stx.setup()

plate = cellvis_384_wellplate_120uL_Fb(name="cells_384")
stx.loading_tray.assign_child_resource(plate)
tap.ask("take the plate in from the transfer station to cassette 1, position 1")
await stx.take_in_plate(rack.sites[0])

tap.ask("fetch the plate back out to the transfer station")
await stx.fetch_plate_to_loading_tray("cells_384")

tap.ask("read the temperature")
temperature = await stx.get_temperature()
What ran in simulation / 4 tests passed
ask   set up: break, CR handshake, activate handling, wait ready
send  CR | ST 1801 | RD 1915
recv  CC | OK | 1
state plate at transfer, ready 1, error 00000, temp 37.0 deg C
ask   take the plate in from the transfer station to cassette 1, position 1
send  WR DM0 1 | WR DM23 788 | WR DM25 22 | WR DM5 1 | ST 1904 | RD 1915 | ST 1903
recv  OK x5 | 1 | OK
state plate at cassette 1/1, ready 1, error 00000, temp 37.0 deg C
ask   fetch the plate back out to the transfer station
send  WR DM0 1 | WR DM23 788 | WR DM25 22 | WR DM5 1 | ST 1905 | RD 1915 | ST 1903
recv  OK x5 | 1 | OK
state plate at transfer, ready 1, error 00000, temp 37.0 deg C
ask   read the temperature
send  RD DM982
recv  370
state plate at transfer, ready 1, error 00000, temp 37.0 deg C
state upstream warning: Liconic racks need to be configured manually on each setup
done  completed: sim: plate path shovel > cassette 1/1 > shovel > transfer; 37.0 deg C
What is real, what is simulated, and the limits found in the source

Real

  • Legacy upstream ExperimentalLiconicBackend and Incubator, unchanged
  • Every command string the backend writes, e.g. WR DM23 788, ST 1904
  • Error codes and messages, e.g. 00103 import lift transfer error

Simulated

  • The STX44 PLC: parsing, CC/OK/1 replies, registers DM0 DM5 DM23 DM25
  • Plate location: transfer station, shovel, cassette slot; temperature
  • Faults: dropped reply to ST 1904; handler error 00103 on the shovel

Not checked

  • Any physical STX44; nothing here ran on hardware
  • Reply to WR and most ST commands assumed OK (TODO_1)
  • Real move times and plate position after a fault (TODO_2)

Limits found in the source

Sources / liconic_backend.py at 182f92e / constants.py (models, error codes) / liconic_backend_tests.py / Legacy Incubator frontend / Device driver guide / devices.json registry entry

Station 5 of 9 / Maker's SDK, nothing to decode

Rail-mounted transfer arm (linear track)

Not in PyLabRobot yet, the maker's SDK documents it. The example writes the class.

How software reaches it
Through the xArm controller with xarm-python-sdk: the same XArmAPI object as the arm calls get/set_linear_motor_*; the SDK sends them as Modbus to the control box RS-485 (xarm-python-sdk xarm/x3/linear_motor.py:40-46).
Where the commands came from
Nothing decoded. Names, units and return codes come from xarm-python-sdk 1.18.4 (xarm-python-sdk xarm/wrapper/xarm_api.py:3648-3805, xarm-python-sdk xarm/x3/linear_motor.py:82-219, xarm-python-sdk xarm/x3/code.py:52-54). A search of PyLabRobot 182f92e for linear track or linear motor finds nothing.

Stand it up

  1. Read the track calls in the SDK: get_linear_motor_pos/status/error/on_zero/is_enabled and set_linear_motor_enable/back_origin/pos (xarm-python-sdk xarm/wrapper/xarm_api.py:3648-3805).
  2. Write 1 plain class with async setup() and stop(); stop() restores the enable state setup() found (device-driver-guide.md:22-23).
  3. Expose intent only: home() and move_to(mm) read the state, act only if needed, then confirm (device-driver-guide.md:39-41).
  4. Issue moves with wait=False and confirm in Python: error register, then motion bit 0 clear (xarm-python-sdk xarm/wrapper/xarm_api.py:3669-3670), then the position report.
  5. Log a warning in setup() that it is unverified (device-driver-guide.md:45-47); test it against a simulated SDK object first.
  6. Teach the station positions on the real track and set a measured reply timeout before any real run.

The example

Home the track if it is not homed, travel to a taught station at 450 mm and 200 mm/s, confirm the arrival from the position report. Positions and speed are made up.

async def travel(track: LinearTrack) -> int:
  await track.setup()  # enables the track if it was off
  await track.home()  # no-op when already homed
  at = await track.move_to(READER_STATION_MM, speed=SPEED_MM_S)
  await track.stop()  # restores the enable state found at setup
  return at

# track = LinearTrack(ip="192.168.1.220", travel_mm=700)
What ran in simulation / 6 tests passed
ask   setup, home, move to 450 mm at 200 mm/s, stop
send  get_linear_motor_is_enabled()
recv  (0, 0)
send  set_linear_motor_enable(True)
recv  0
send  get_linear_motor_on_zero()
recv  (0, 0)
send  set_linear_motor_back_origin(wait=False,auto_enable=True)
recv  0
send  get_linear_motor_on_zero()
recv  (0, 1)
send  get_linear_motor_pos()
recv  (0, 0)
send  set_linear_motor_pos(450,speed=200,wait=False)
recv  0
send  get_linear_motor_error()
recv  (0, 0)
send  get_linear_motor_status()
recv  (0, 0)
send  get_linear_motor_pos()
recv  (0, 450)
send  set_linear_motor_enable(False)
recv  0
state pos 450 mm, enabled 0, on_zero 1, error 0, moves 1
done  completed: position report 450 mm == taught 450 mm, error register 0
What is real, what is simulated, and the limits found in the source

Real

  • Method names, arguments, units and return codes copied from xarm-python-sdk 1.18.4
  • Error register titles copied from the SDK code table

Simulated

  • The SDK object: position, enable, homed, motion and error registers
  • Instant motion. lost_reply: the move runs, the position report after it never returns
  • Which error appears (13)

Not checked

  • Any physical track
  • linear_track.py itself on hardware
  • Real travel times and a sane timeout

Limits found in the source

  • The SDK refuses set_linear_motor_pos with code 82 until on_zero is 1, so on_zero acts as a homed flag (xarm-python-sdk xarm/x3/linear_motor.py:158-161).
  • The SDK sends int(pos*2000) (xarm-python-sdk xarm/x3/linear_motor.py:166) but reports position as round(raw/2000), whole mm (xarm-python-sdk xarm/x3/linear_motor.py:58).
  • Stroke depends on the serial number: 0..700, 0..1000 or 0..1500 mm; speed 1..1000 mm/s (xarm-python-sdk xarm/wrapper/xarm_api.py:3795-3799).
  • The SDK's own wait polls every 0.1 s for up to 100 s by default and returns 80 on any error register (xarm-python-sdk xarm/x3/linear_motor.py:221-240).
  • After a hold or an error the example sends nothing more, so stop() does not run and the track stays enabled until a person checks it. The guide asks for cleanup on errors too (device-driver-guide.md:23); what is safe to send after an unknown outcome is an open point.

Sources / PyLabRobot device-driver guide / xArm Python SDK API doc, master branch (linear motor calls)

Station 6 of 9 / Maker's SDK, nothing to decode

UFACTORY xArm 6 plate arm

In PyLabRobot (XArm6). It wraps the maker's published Python SDK, so there is no wire to decode.

How software reaches it
Ethernet to the xArm controller through xarm-python-sdk (hello-world.ipynb:12). XArmAPI(ip) is created in setup(), then each operation is 1 blocking SDK call run in a thread (xarm6.py:86).
Where the commands came from
Nothing decoded. The driver calls the maker's SDK (xarm6.py:120-122) and checks only its return code (xarm6.py:60-95). The registry lists it as status basic (devices.json:2132).

Drive the real one

  1. Install the optional SDK extra: pip install PyLabRobot[xarm] (hello-world.ipynb:12).
  2. Create XArm6(ip=..., tcp_offset=...) with the controller IP and your gripper mount offset, then await setup().
  3. Teach the hotel and reader poses: start_freedrive_mode(free_axes=[0]), request_gripper_pose(), stop_freedrive_mode() (hello-world.ipynb:282).
  4. Open with move_gripper(width=max_gripper_width). The driver's default jaw range is 71 to 150 mm (xarm6.py:41-42): set it to your gripper.
  5. Wrap pick_up_at_location and drop_at_location with your own above-pose moves; they only move and grip (xarm6.py:270-271).
  6. Put a timeout around each call and check the plate yourself; the driver reports no plate-held state.

The example

Carry 1 plate from a hotel nest to the reader nest: above pick, open, descend, close, lift, above place, descend, open, retreat. All poses are made up.

async def carry(arm: XArm6) -> None:
  up = Coordinate(z=80)
  down = Rotation(x=180, y=0, z=0)
  await arm.move_to_location(HOTEL + up, down)
  await arm.move_gripper(width=arm.max_gripper_width)
  await arm.pick_up_at_location(HOTEL, down, resource_width=80)
  await arm.move_to_location(HOTEL + up, down)
  await arm.move_to_location(READER + up, down)
  await arm.drop_at_location(READER, down, resource_width=80)
  await arm.move_to_location(READER + up, down)

# arm = XArm6(ip="192.168.1.220"); await arm.setup(); await carry(arm)
What ran in simulation / 7 tests passed
ask   setup()
state setup made 9 SDK calls, all returned 0; mode 0, state 0, gripper enabled True
ask   carry 1 plate: hotel nest -> reader nest
send  set_position(x=300,y=200,z=180,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
send  set_gripper_position(850,wait=True,speed=0)
recv  0
send  set_position(x=300,y=200,z=100,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
send  set_gripper_position(97,wait=True,speed=0)
recv  0
send  set_position(x=300,y=200,z=180,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
send  set_position(x=300,y=-200,z=130,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
send  set_position(x=300,y=-200,z=50,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
send  set_gripper_position(850,wait=True,speed=0)
recv  0
send  set_position(x=300,y=-200,z=130,roll=180,pitch=0,yaw=0,speed=100,mvacc=2000,wait=True)
recv  0
state plate at reader, pose [300, -200, 130], error_code 0
done  completed: plate at reader nest, jaws at 850 of 850 units, error_code 0
What is real, what is simulated, and the limits found in the source

Real

  • Upstream pylabrobot.ufactory.xarm6.XArm6 at 182f92e
  • Every SDK call and argument it makes
  • Its error raising (XArm6Error)

Simulated

  • The XArmAPI object: pose, jaws, error and state codes
  • Where the plate is
  • The SDK return codes, copied from xarm-python-sdk 1.18.4

Not checked

  • Any physical arm or bio-gripper
  • Real move times and a sane timeout (TODO_1)
  • Whether the gripper moves while the arm is in an error state

Limits found in the source

  • A return code of 0 or None is success: _call_sdk never reads the arm error_code or state (xarm6.py:91). For non-move calls the SDK maps codes 1, 2 and 9 to 0 (xarm-python-sdk xarm/x3/base.py:2179).
  • A grip width outside the range is clamped to it with no error, 71 to 150 mm by default (xarm6.py:149-152).
  • No plate-held query. is_gripper_closed() only compares the reported width to 73 mm by default (xarm6.py:185-188 and xarm6.py:43).
  • move_gohome is retried once after clear_errors (xarm6.py:205-212); moves are not retried (xarm6.py:239-251).

Sources / xarm6.py / xarm6_tests.py / xArm 6 hello-world notebook / devices.json

Station 7 of 9 / Nothing to decode

Passive plate hotel

No controller, so nothing to decode. In PyLabRobot it is a resource: plate holders on a carrier.

How software reaches it
Nothing to reach: no wire. Software keeps a model of what sits on each shelf (PyLabRobot resources) and the arm that loads it is the only actor. The scheduler owns reservations and timers.
Where the commands came from
Nothing decoded. PyLabRobot 182f92e has no hotel class; the example uses a PlateCarrier (carrier.py:269-331) with 24 PlateHolder sites (carrier.py:159-211). Assigning to a taken spot raises ValueError (carrier.py:79-87).

Stand it up

  1. Measure the shelf pitch, the first shelf height and the plate seat; put them in a PlateCarrier of PlateHolder sites.
  2. Set pedestal_size_z for each PlateHolder; the constructor raises ValueError without it (carrier.py:184-189).
  3. Place with hotel[slot] = plate and remove with hotel[slot] = None, so a taken spot raises instead of stacking (carrier.py:104-111).
  4. Keep reservations and dwell timers in the scheduler, with a clock you can inject in tests.
  5. Free a slot only after the arm confirms the pickup; an unconfirmed pickup keeps the slot reserved.
  6. Teach the arm 1 pose per shelf and check each against the model before the first run.

The example

Reserve shelf 5, place 1 skirted 384-well assay plate, wait a 600 s dwell on a simulated clock, pick it up, free the shelf. Sizes, pitch and dwell are made up.

hotel_sched = Scheduler(hotel, sim, clock)
plate = Greiner_384_wellplate_28ul_Fb("assay_plate_1")
log("ask   reserve slot 5, place, dwell 600 s, pick up")
hotel_sched.reserve(5, plate.name)
try:
  hotel_sched.place(5, plate)  # hotel[5] = plate
except ValueError as e:  # "spot 5 already has a resource" (carrier.py:86)
  out.update(outcome="error", evidence=f"ValueError: {e}")
else:
  clock.advance(DWELL_S)
  log(f"state t={clock.now_s:g} s, dwell done: {hotel_sched.dwell_done(5)}")
  if hotel_sched.pick_up(5):
    out.update(outcome="completed", evidence="pickup confirmed, slot 5 free")
  else:
    out.update(outcome="hold", evidence=f"pickup sent {sim.pickups} time, no "
               "confirmation; slot 5 stays reserved")
What ran in simulation / 5 tests passed
ask   reserve slot 5, place, dwell 600 s, pick up
send  place slot=5 plate=assay_plate_1
recv  place ok slot=5
state t=600 s, dwell done: True
send  pickup slot=5 plate=assay_plate_1
recv  pickup ok slot=5
state model slot 5: None; shelf 5: None; reserved: []
done  completed: pickup confirmed, slot 5 free
What is real, what is simulated, and the limits found in the source

Real

  • Upstream PlateCarrier, PlateHolder and Plate classes
  • The ValueError raised for a taken spot
  • An upstream 384-well plate definition (Greiner 784075)

Simulated

  • The clock
  • What is physically on each shelf
  • The arm's place and pickup confirmations

Not checked

  • Any physical hotel or its dimensions
  • The arm poses per shelf

Limits found in the source

  • lost_reply maps to a pickup with no confirmation; device_error maps to placing into a taken spot (carrier.py:86).
  • Only hotel[slot] = plate refuses a taken spot. PlateHolder.assign_child_resource defaults to reassign=True (carrier.py:195-211), and then adds a 2nd plate with no error (resource_holder.py:74-76).
  • PlateHolder refuses non-skirted plates (carrier.py:209-210) and needs pedestal_size_z (carrier.py:184-189).
  • No reservations or timers in pylabrobot/resources; the scheduler in drive.py is this example's own code.

Sources / carrier.py / resource_holder.py / greiner/plates.py (384-well plate used)

Station 8 of 9 / Not decoded yet

BMG LABTECH PHERAstar FSX

Not in PyLabRobot. Upstream drives 2 other BMG readers; this one's commands are unknown.

How software reaches it
Unknown. Upstream's 2 BMG readers share 1 framing module: the CLARIOstar speaks FTDI frames (STX, size, header, payload, 24-bit sum, CR) or USB packets, the VANTAstar USB only. The host asks, then polls status.
Where the commands came from
Nothing decoded. The example runs the method on a synthetic reader whose payloads are the text TODO_1..TODO_4. Upstream has no PHERAstar code; its registry lists only CLARIOstar and VANTAstar for BMG (devices.json:253-287).

Decode it

  1. Check how it enumerates on USB (FTDI bridge or native USB, VID and PID) against the 2 BMG readers upstream drives (framing.py:6 and framing.py:4).
  2. Capture the vendor software doing 1 action at a time (tray out, tray in, 1 read), marking each action, with plr-re capture and marks.
  3. Test the sibling framing on the capture: does every frame fit the FTDI frame or the USB packet layout (framing.py:3-17)?
  4. Map status and error replies before any motion: which bits mean busy, tray out, refused, error, and which codes come back.
  5. Write the 1-class driver and replay the captured transcripts as tests through a fake transport, per the device-driver guide section 5.
  6. First live command read-only (status), then the tray, then a read of an empty plate, with a person at the reader.

The example

A stand-in for the vendor software moves the tray out and in and reads a 384-well plate on a synthetic reader; the frames are captured, decoded, replayed behind guards, then read by a draft class.

reader = PHERAstarDraft(transport=transport)  # unverified, commands are TODO_n
await reader.setup()  # logs a loud "unverified" warning
try:
  await reader.ensure_tray_in()  # reads state, moves only if needed, confirms
  values = await reader.read_plate()  # 1 read command, never re-sent
  outcome = "completed"
  evidence = f"{len(values)} made-up values, well A1 = {values[0]}"
except ReplyLost as e:  # read sent, no reply: stop here, a human checks
  outcome, evidence = "hold", str(e)
except ReaderDeviceError as e:  # error bit set in the reply
  outcome, evidence = "error", f"device error codes {e.codes} (synthetic code)"
finally:
  await reader.stop()
What ran in simulation / 7 tests passed
ask   (a) capture: vendor stand-in does 3 actions, 1 at a time, each marked
state captured tray_out: TODO_1 + TODO_4; tray out, plate on tray, plates read 0
state captured tray_in: TODO_2 + TODO_4; tray in, plate on tray, plates read 0
state captured read_plate: TODO_3 + TODO_4; tray in, plate on tray, plates read 1
ask   (b) decode: framing, then group frames by action mark
state 6 host frames fit STX|size|hdr|payload|sum24|CR, header 0x3f; Modbus RTU frames found: 0
state in every window (status candidate): b'TODO_4'
state tray_out vs tray_in differ at offsets [9, 12]
state protocol map coverage 4/4
ask   (c) replay TODO_3 (read) behind plr_re guards: armed, actuation allowed (sim)
send  02 00 0e 3f 54 4f 44 4f 5f 33 00 02 17 0d
recv  02 03 0c 3f 7d 03 02 00 03 e8 04 0d 04 32 04 57 04 7c 04 a1 04 c6 04 eb ... (780 bytes)
state replay: 384 values back; tray in, plate on tray, plates read 2
ask   (d) the same read through the draft driver class
send  02 00 0e 3f 54 4f 44 4f 5f 34 00 02 18 0d
recv  02 00 12 3f 01 03 02 00 05 00 00 00 00 00 00 00 5e 0d
send  02 00 0e 3f 54 4f 44 4f 5f 33 00 02 17 0d
recv  02 03 0c 3f 7d 03 02 00 03 e8 04 0d 04 32 04 57 04 7c 04 a1 04 c6 04 eb ... (780 bytes)
state tray in, plate on tray, plates read 3; executed in (d): {'TODO_3': 1}
done  completed: 384 made-up values, well A1 = 1000
What is real, what is simulated, and the limits found in the source

Real

  • Upstream BMG framing functions build and check every frame
  • plr_re Marks, load_serial_log, diff_frames, scan_modbus_stream, ProtocolMap, GuardedReplayer

Simulated

  • The reader, its tray, plate and 384 made-up values
  • Every command payload: ASCII TODO_1..TODO_4, not PHERAstar bytes
  • The vendor software session that was captured

Not checked

  • Any PHERAstar byte, port, header, status bit or error code
  • Whether the PHERAstar shares the CLARIOstar and VANTAstar framing
  • The draft class on any hardware

Limits found in the source

  • BMG's page says its readers can be controlled through ActiveX, DDE and SiLA interfaces, documented in its software manuals. That route may need no wire decoding.
  • Same maker as 2 decoded readers is a hypothesis to test first, not a result. Upstream lists CLARIOstar firmware 1.35 only as checked on hardware (confirmed_firmware_versions.py:5).
  • plr_re replays a stored frame and reads once (replay.py:99-102), 512 bytes by default (transports.py:24). The example reads the rest of the 780-byte reply itself.
  • plr_re splits only Modbus RTU streams (decode.py:132) and drops timestamps on load (decode.py:160-170). The example splits and groups by marks itself.

Sources / BMG LABTECH workflow automation / Upstream BMG framing / Upstream VANTAstar reply format / Upstream device-driver guide / Upstream device registry / plr-re capture and marks / plr-re decode / plr-re guarded replay / plr-re byte connections / plr-re protocol map

Station 9 of 9 / Nothing to decode

Shared LC-MS bench

Not in PyLabRobot. The toolkit playbook's route, a Ready line and a Start line, needs no decoding.

How software reaches it
Rear remote connector: software reads a Ready line and closes a Start contact through opto-isolators (README.md:88-97). The vendor software holds the method. Raw files are picked up from a data folder.
Where the commands came from
Nothing to decode for this route. Upstream has no LC, MS or autosampler driver (no match in pylabrobot/ or devices.json). The signals come from the toolkit playbook; its LAN control map is still in progress (README.md:164-165).

Stand it up

  1. Find the model, photograph the rear panel and read the remote connector pinout from its manual; do not assume pin numbers (README.md:93-95).
  2. Wire Ready, Start, Stop and ground through opto-isolators or relays; never wire GPIO straight to the instrument (WIRING.md:33-35).
  3. Find the Ready line and its sense with the toolkit's line scan command (cli.py:63-77), then confirm Ready read-only before any Start.
  4. Load the injection sequence and method in the vendor acquisition software.
  5. With a person present, close Start for 1 injection and check that 1 raw file appears in the data folder.
  6. Point the adapter at the data folder and match each injection to its raw file before the next Start.

The example

8 aliquots from 1 plate as an injection sequence: for each, check Ready, log the dry-run Start (nothing sent), wait for its raw file. A missing file holds; Ready low stops with the fault text.

remote = Agilent6530Remote(PINS, Guards(armed=False), io=station)  # dry run
for row, aliquot in enumerate(aliquots, 1):
  if not remote.is_ready():  # reads the Ready line
    outcome = "error"
    evidence = f"Ready low before row {row}: {station.fault_text}; no Start sent"
    break
  remote.start_run()  # dry run: logs the Start pulse, sends nothing
  for note in notes.notes:
    log(f"send  {note}")
    station.on_note(note)  # the simulated workstation acts on it
  notes.notes.clear()
  raw = await wait_for_raw_file(raw_dir, row, aliquot)
  if raw is None:  # started, no file: hold, never start this aliquot again
    outcome = "hold"
    evidence = f"row {row} {aliquot} started, no raw file; not re-injected"
    break
  matched[aliquot] = raw
  log(f"recv  {raw}")
What ran in simulation / 5 tests passed
ask   run sequence.csv: 8 injections from PLATE01, 1 start each
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  001_PLATE01-A1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  002_PLATE01-B1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  003_PLATE01-C1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  004_PLATE01-D1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  005_PLATE01-E1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  006_PLATE01-F1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  007_PLATE01-G1.raw.stub
send  [dry-run] would pulse START on BCM27 for 0.25s
recv  008_PLATE01-H1.raw.stub
state ready True, rows started 8/8, raw files 8; starts per aliquot max 1
done  completed: 8/8 injections matched to a raw file
What is real, what is simulated, and the limits found in the source

Real

  • plr_re contact-closure controller and guards, in dry run (the example in the playbook)
  • The Start note the toolkit logs in dry run

Simulated

  • The acquisition workstation, its Ready line and sequence
  • Raw files: 1 text stub per injection in a temporary folder
  • Aliquot ids, volumes, fault text

Not checked

  • Whether the hall's LC-MS has a remote Ready and Start connector
  • Any pin, polarity or pulse length on hardware
  • How long an injection takes and how the real raw files are named

Limits found in the source

  • The toolkit's Start and Ready path has mock and dry-run tests only (test_plr_re.py:108-131 and README.md:119-120); hardware validation is still to come (README.md:166).
  • In dry run start_run transmits nothing (agilent6530.py:97-103); the example relays the logged note to the simulator.
  • Start is 1 TTL line and carries no sample id (WIRING.md:10-20). The vendor sequence sets the order, so the adapter matches by row, with a file name rule made up here.
  • wait_ready sleeps for real (agilent6530.py:86-93), so the example reads is_ready once per injection instead.

Sources / Upstream device registry / Toolkit playbook (LC-MS example) / Toolkit playbook wiring / Toolkit contact-closure controller / Toolkit tests / Toolkit README / Toolkit example pin map

The central harness

1 plate through all 9

Every station answers the harness the same way: completed, hold, or error.

The first run is clean. In the second run the reader carries out the read and its reply is lost. The harness holds, sends no second read, and does not ask the next station.

run SIM-001, clean: 18 record lines in harness/runs/SIM-001.jsonl
  1 culture  completed  CB-0001 released, worklist WL-7 matches
  2 seed     completed  sim: 24/24 columns at 40 uL/well, peristaltic pump, plate byte 1 (384 std)
  3 star     completed  destination col 1: [55.1] uL each (50 uL asked + liquid class); 96 tips i...
  4 inc      completed  sim: plate path shovel > cassette 1/1 > shovel > transfer; 37.0 deg C
  5 rail     completed  position report 450 mm == taught 450 mm, error register 0
  6 xarm     completed  plate at reader nest, jaws at 850 of 850 units, error_code 0
  7 hotel    completed  pickup confirmed, slot 5 free
  8 reader   completed  384 made-up values, well A1 = 1000
  9 lcms     completed  8/8 injections matched to a raw file
run SIM-002, the reader's reply is lost: 16 record lines in harness/runs/SIM-002.jsonl
  1 culture  completed  CB-0001 released, worklist WL-7 matches
  2 seed     completed  sim: 24/24 columns at 40 uL/well, peristaltic pump, plate byte 1 (384 std)
  3 star     completed  destination col 1: [55.1] uL each (50 uL asked + liquid class); 96 tips i...
  4 inc      completed  sim: plate path shovel > cassette 1/1 > shovel > transfer; 37.0 deg C
  5 rail     completed  position report 450 mm == taught 450 mm, error register 0
  6 xarm     completed  plate at reader nest, jaws at 850 of 850 units, error_code 0
  7 hotel    completed  pickup confirmed, slot 5 free
  8 reader   hold       no reply to b'TODO_3'; not re-sent, reader state unknown
  9 lcms     not asked  waiting behind reader

19 harness tests passed: each of the 9 stations with a lost reply and with an instrument error.

Run it yourself

3 commands

uv run pytest                          # all 79 tests
uv run python -m stations.star.drive   # 1 station, with its wire traffic
uv run python -m harness.walk          # 1 plate through all 9

To watch the runs step by step, open replay.html. It plays the trace files that uv run python -m harness.trace records.

Read this before quoting the page

What this is not