On Wed, 13 Nov 2019 at 11:27, Gene Heskett <[email protected]> wrote:

> Reading the man pages for master as I just built on the rpi4, I still
> can't find a pin on "motion" that tallies its g20/g21 state.

I don't think motion knows. Motion lives in an entirely metric world.
G20 / G21 is almost like a preprocessor macro for the interpreter, and
the G20/G21 status only has any meaning inside the interpreter.

So, it's a G-code status not a machine status.

It wouldn't be hard to make a Python HAL component that gives you the
units: (Note that this is entirely untested, and written in a Gmail
window, so the tab-stops should not be trusted either. And I don't
even know if I have G20 and G21 the right way round,

#!/usr/bin/env python
import hal, time, linuxcnc
h = hal.component("units")
h.newpin("G21", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("G20", hal.HAL_BIT, hal.HAL_OUT)
h.ready()
s = linuxcnc.stat()
try:
    while 1:
        time.sleep(1)
        s.poll()
        if s,program_units() == 1:
              h['G21'] = 0
              h['G20'] = 1
        else:
              h['G21'] = 1
              h['G20'] = 0
except KeyboardInterrupt:
    raise SystemExit



-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916


_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to