So help me with a bigger picture- This feature could be exposed to the HAL by Python code alone, so there's no compile stage?
Does this require modifying existing files from LinuxCNC, or just adding new files? What directory would that go in? If I make this change in my current LinuxCNC, what would it be like to import those changes into a new version of LinuxCNC? Danny ---- andy pugh <bodge...@gmail.com> wrote: > On 6 October 2016 at 01:45, Sebastian Kuzminsky <s...@highlab.com> wrote: > In python it's in linuxcnc.stat.settings[2]. Maybe not the most > intuitive name for it... Indeed not. This works as a userspace component. #!/usr/bin/python import hal, time import linuxcnc h = hal.component("status") h.newpin("spindle-preset", hal.HAL_FLOAT, hal.HAL_OUT) h.ready() s = linuxcnc.stat() try: while 1: time.sleep(1) s.poll() h['spindle-preset'] = s.settings[2] 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 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users