@@ -805,6 +805,22 @@ static PyObject *Stat_tool_table(pyStatChannel * /*s*/, void *) {
805805 return res;
806806}
807807
808+ static PyObject *Stat_heartbeat (pyStatChannel *s, void *) {
809+ #if PY_VERSION_HEX >= 0x030e00f0 // 3.14
810+ return PyLong_FromUInt64 (s->status .motion .heartbeat );
811+ #else
812+ return PyLong_FromUnsignedLongLong (s->status .motion .heartbeat );
813+ #endif
814+ }
815+
816+ static PyObject *Stat_taskbeat (pyStatChannel *s, void *) {
817+ #if PY_VERSION_HEX >= 0x030e00f0 // 3.14
818+ return PyLong_FromUInt64 (s->status .task .taskbeat );
819+ #else
820+ return PyLong_FromUnsignedLongLong (s->status .task .taskbeat );
821+ #endif
822+ }
823+
808824static PyGetSetDef Stat_getsetlist[] = {
809825 {(char *)" actual_position" , (getter)Stat_actual, NULL , NULL , NULL },
810826 {(char *)" ain" , (getter)Stat_ain, NULL , NULL , NULL },
@@ -838,6 +854,12 @@ static PyGetSetDef Stat_getsetlist[] = {
838854 (char *)" The tooltable, expressed as a list of tools. Each tool is a dict with the\n "
839855 " tool id (tool number), diameter, offsets, etc." , NULL
840856 },
857+ {(char *)" heartbeat" , (getter)Stat_heartbeat, NULL ,
858+ (char *)" Motion controller heartbeat counter. Increments every servo cycle." , NULL
859+ },
860+ {(char *)" taskbeat" , (getter)Stat_taskbeat, NULL ,
861+ (char *)" Task main loop heartbeat counter. Increments every task cycle." , NULL
862+ },
841863 {}
842864};
843865
0 commit comments