From 3a91e3b603e8f6ef5feaba23a8048e8c00f66193 Mon Sep 17 00:00:00 2001 From: lyn1dev <78355114+lyn1dev@users.noreply.github.com> Date: Thu, 26 Nov 2026 00:14:04 +0100 Subject: [PATCH 1/2] docs: clarify that python task_state never returns STATE_OFF --- docs/src/config/python-interface.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/config/python-interface.adoc b/docs/src/config/python-interface.adoc index d9bd12cd54f..b6e99908dfe 100644 --- a/docs/src/config/python-interface.adoc +++ b/docs/src/config/python-interface.adoc @@ -369,7 +369,8 @@ see <> for an example. task paused flag. *task_state*:: '(returns integer)' - - current task state. One of `STATE_ESTOP`, `STATE_ESTOP_RESET`, `STATE_ON`, `STATE_OFF`. + current task state. One of `STATE_ESTOP`, `STATE_ESTOP_RESET`, `STATE_ON`. + `STATE_OFF` is never returned; when the machine is out of E-Stop and powered off, `task_state` is `STATE_ESTOP_RESET`. *tool_in_spindle*:: '(returns integer)' - current tool number. @@ -832,6 +833,7 @@ c.spindle.(linuxcnc.SPINDLE_OFF, 0) `state(int)`:: Set the machine state. Machine state should be `STATE_ESTOP`, `STATE_ESTOP_RESET`, `STATE_ON`, or `STATE_OFF`. + Calling `state(STATE_OFF)` turns the machine off and transitions `task_state` to `STATE_ESTOP_RESET`. `task_plan_sync()`:: On completion of this call, the VAR file on disk is updated with live values from the interpreter. From d4281a17d458bd391c3addaaada8d5f6590491dd Mon Sep 17 00:00:00 2001 From: lyn1dev <78355114+lyn1dev@users.noreply.github.com> Date: Sat, 28 Nov 2026 00:47:33 +0100 Subject: [PATCH 2/2] docs: clarify task_state return values and command behavior Signed-off-by: lyn1dev <78355114+lyn1dev@users.noreply.github.com> --- docs/src/config/python-interface.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/src/config/python-interface.adoc b/docs/src/config/python-interface.adoc index b6e99908dfe..7eb85883636 100644 --- a/docs/src/config/python-interface.adoc +++ b/docs/src/config/python-interface.adoc @@ -370,7 +370,8 @@ see <> for an example. *task_state*:: '(returns integer)' - current task state. One of `STATE_ESTOP`, `STATE_ESTOP_RESET`, `STATE_ON`. - `STATE_OFF` is never returned; when the machine is out of E-Stop and powered off, `task_state` is `STATE_ESTOP_RESET`. + `STATE_OFF` is never returned: when the machine is out of E-Stop and powered off, `task_state` is `STATE_ESTOP_RESET`. + `STATE_OFF` is only a command value for `state()`, so do not compare `task_state` against it. *tool_in_spindle*:: '(returns integer)' - current tool number. @@ -833,7 +834,7 @@ c.spindle.(linuxcnc.SPINDLE_OFF, 0) `state(int)`:: Set the machine state. Machine state should be `STATE_ESTOP`, `STATE_ESTOP_RESET`, `STATE_ON`, or `STATE_OFF`. - Calling `state(STATE_OFF)` turns the machine off and transitions `task_state` to `STATE_ESTOP_RESET`. + From `STATE_ON`, calling `state(STATE_OFF)` turns the machine off and `task_state` becomes `STATE_ESTOP_RESET`. `task_plan_sync()`:: On completion of this call, the VAR file on disk is updated with live values from the interpreter.