Skip to content

fix(liconic): wait for the z-lift to reach the read position before scanning a barcode#1116

Merged
rickwierenga merged 1 commit into
PyLabRobot:mainfrom
myotwin:fix/liconic-scan-barcode-wait-ready
Jun 26, 2026
Merged

fix(liconic): wait for the z-lift to reach the read position before scanning a barcode#1116
rickwierenga merged 1 commit into
PyLabRobot:mainfrom
myotwin:fix/liconic-scan-barcode-wait-ready

Conversation

@dinukajayalath

Copy link
Copy Markdown
Contributor

Summary:

What

ExperimentalLiconicBackend.scan_barcode() sent the ST 1910 move command to position the z-lift at the read height and then immediately triggered the scan, without waiting for the move to finish. The beam latched on while the lift was
still travelling, so it decoded whichever plate it passed en route instead of the requested level — e.g. on an STX220 with plates at levels 22 and 10, Scanning level 5 returned level 10's barcode.

This adds await self._wait_ready() between ST 1910 and the scan, matching every other motion-issuing method in the backend (open_door, close_door, initialize, take_in_plate, move_position_to_position) and the sibling read_barcode_inline(), which already pair their ST command with _wait_ready(). scan_barcode() was the only one missing it.

Fixes #1115

Test

Added TestScanBarcode to liconic_backend_tests.py: it asserts ST 1910 is sent and _wait_ready is awaited. Verified it fails against the pre-fix code.

Also verified on hardware (STX220): plates loaded at two levels, scanning a lower third level now returns the requested level's barcode rather than one the lift passes on the way down.

Happy to make any changes upon reviewing

scan_barcode sent ST 1910 to move the lift to the read position and then
fired the scan immediately, without waiting for the move to finish. The
beam latched on while the lift was still travelling and decoded whichever
plate it passed en route — requesting a scan of level 5 with a plate at
level 10 returned level 10's barcode. Await _wait_ready() after ST 1910,
matching every other motion method in the backend (open_door, take_in_plate,
move_position_to_position, and the sibling read_barcode_inline).

Fixes PyLabRobot#1115

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rickwierenga rickwierenga merged commit 963360c into PyLabRobot:main Jun 26, 2026
21 checks passed
@rickwierenga

Copy link
Copy Markdown
Member

thanks!

@dinukajayalath dinukajayalath deleted the fix/liconic-scan-barcode-wait-ready branch June 26, 2026 07:31
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.

Liconic scan_barcode() triggers scan before z-lift finishes moving — reads wrong level's barcode

2 participants