pylabrobot.generic.SerialBarcodeScanner.scan_barcode#

async SerialBarcodeScanner.scan_barcode(read_time: float | None = None, symbology: Literal['ISBT Standard', 'Code 128 (Subset B and C)', 'Code 39', 'Codebar', 'Code 2of5 Interleaved', 'UPC A/E', 'YESN/EAN 8', 'Code 93', 'ANY 1D', 'unknown'] = 'unknown', position_on_resource: Literal['right', 'front', 'left', 'back', 'bottom', 'top'] = 'bottom') Barcode | None#

Scan one barcode from the serial stream.

Parameters:
  • read_time (float | None) – Maximum number of seconds to wait for a barcode. If omitted, the configured serial read timeout is used.

  • symbology (Literal['ISBT Standard', 'Code 128 (Subset B and C)', 'Code 39', 'Codebar', 'Code 2of5 Interleaved', 'UPC A/E', 'YESN/EAN 8', 'Code 93', 'ANY 1D', 'unknown']) – Symbology assigned to the returned barcode.

  • position_on_resource (Literal['right', 'front', 'left', 'back', 'bottom', 'top']) – Position assigned to the returned barcode.

Returns:

The scanned barcode, or None if no data is received before the timeout.

Return type:

Barcode | None