On 3/2/24 10:28, Andy Pugh wrote:


On 2 Mar 2024, at 12:35, gene heskett <ghesk...@shentel.net> wrote:

I renamed tholefinder.ngc to tholefinder,

Leave the filename the same.
Rename the subroutine inside that file.
Call it by the subroutine name.

I did that, it worked but now complains about a syntax error in that file. But without reporting a line number or anything that might lead to locating it. And I have another problem, tholefinder was written in inch days, last used for inch measurements. To make it smarter I need to have it check the machines units with units.comp, which I finally found a copy of but halcompile flat refuses to do anything with it. Every combo the manpage shows exits with:

gene@GO704:~/linuxcnc/configs/go704-xyza$ halcompile --install units.comp
Traceback (most recent call last):
  File "/usr/bin/halcompile", line 1558, in <module>
    main()
  File "/usr/bin/halcompile", line 1528, in main
    process(f, mode, outfile)
  File "/usr/bin/halcompile", line 1366, in process
    a, b = parse(filename)
  File "/usr/bin/halcompile", line 441, in parse
    a, b = f.split("\n;;\n", 1)
ValueError: not enough values to unpack (expected 2, got 1)

units.comp file attached

Is the man page for halcompile duff? This is master, apt updated early this morning. On buster of course.

_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers
.
Thank you.

Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
#!/usr/bin/python

#  Author: Kurt Jacobson
#    Date: 04/15/17
#   Email: kurtjacob...@bellsouth.net
# License: GPL 

import hal, time
import linuxcnc

stat = linuxcnc.stat()

h = hal.component("units")
h.newpin("prog_in", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("prog_mm", hal.HAL_BIT, hal.HAL_OUT)
h.newpin("update_rate", hal.HAL_FLOAT, hal.HAL_IN)

h.ready()

# Set default update rate to 50ms
h.update_rate = .05

try:
    while 1:
        time.sleep(h.update_rate)
        stat.poll()
        prog_units = stat.program_units
        if prog_units == 1: # Inch
            h.prog_in = 1
            h.prog_mm = 0
        elif prog_units == 2: # Metric
            h.prog_in = 0
            h.prog_mm = 1
except KeyboardInterrupt:
    raise SystemExit
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to