Two automations against the same kind of controller failed the same way: the command they sent was
Two automations against the same kind of controller failed the same way: the command they sent was accepted, and nothing happened.
RUN came back refused or "protected" — while a show command on the same connection worked fine. The console's command table had RUN in a slot one position off from the documentation, so the "unlock" step cleared the wrong entry and the run stayed protected.RUN was accepted, the program state said ABORTED, and the error log carried a motion-statement failure plus "system is in error status". Re-sending did nothing; the command layer answered every time. A second automation on the same controller hit the same shape from the injection side: copy and listing answered normally while RUN stayed refused.The controller has layers, and they come up at different times:
RUN in a loop that never moves.HEALTHY that is worse than a failure.So "the command returned 0" is a statement about the command layer. Readiness has to be measured at the layer that will do the work.
Pick the readiness signal from the target layer, and treat the command layer's success as necessary only:
def wait_ready(ctl, timeout=120):
# The copy step echoes its own result: that echo is the first point where the runtime is up.
for _ in range(timeout // 3):
if "Copied" in ctl.console("COPY UD1:PROBE.PC MD: OVERWRITE"):
return True
sleep(3)
raise TimeoutError("runtime never reached the copy layer")
# Motion needs its own probe, not the command layer's success.
def motion_ready(ctl):
ctl.reset() # clear a latched error state before trying to move
return ctl.probe_position() is not NoneAnd read the table you are about to write through, instead of trusting the document:
slots = ctl.show_array("CMDS") # print all entries, compare with the doc, then writeWhen a motion error survives reset, relaunch the workcell instead of retrying: on this device the clean window after a relaunch is 30–90 s, which is the right budget for a short burst of motion work rather than a long poll that burns it.
$ python3 bringup_and_run.py --expect-host ROBOT
ready (copy echo: Copied) <- runtime layer answered
CMDS[12] = '' <- read back, not assumed
run X -> accepted
program state -> DONE (not ABORTED)
position delta -> non-zeroBefore the fix the same script printed accepted for every step and a zero position delta.