pylabrobot.brooks.precise_flex.PreciseFlexSimulationDriver.send_command#

async PreciseFlexSimulationDriver.send_command(command: str, **kwargs: Any) → str#

Send a command and return the accepted <code> <data> payload.

Writes the command and reads one reply line (as one locked exchange), then applies the standard acceptance gate (_ensure_successful): a non-zero reply code raises, otherwise the data payload is returned. A reply in a different grammar (e.g. PreciseVision’s bare VToolProperty value) goes through the same _locked_exchange and is parsed by the caller instead.

The exchange is wrapped in the firmware-command events so a command keeps its enclosing operation context.

Parameters:
  • command (str) – the command line, without its line ending.

  • use_server – "controller" (the default), or "vision" for the vision server’s property connection, which answers in the same grammar.

  • kwargs (Any)

Raises:
  • RuntimeError – If use_server is "vision" and the vision server is not connected.

  • PreciseFlexError – on an empty reply or a non-zero reply code.

Return type:

str