Re: [Emc-developers] Dynamically building a string for a varname?
On 3/2/24 10:28, Andy Pugh wrote: On 2 Mar 2024, at 12:35, gene heskett 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 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
Re: [Emc-developers] Emc-developers Digest, Vol 215, Issue 3
Andy, I think you are telling Gene that the subroutine should be named o but the file should still be “tholefinder.ngc”. Is that correct? Thanks for the clarification, Alan Sent from my iPhone > On Mar 2, 2024, at 9:28 AM, emc-developers-requ...@lists.sourceforge.net > wrote: > > Send Emc-developers mailing list submissions to >emc-developers@lists.sourceforge.net > > To subscribe or unsubscribe via the World Wide Web, visit >https://lists.sourceforge.net/lists/listinfo/emc-developers > or, via email, send a message with subject or body 'help' to >emc-developers-requ...@lists.sourceforge.net > > You can reach the person managing the list at >emc-developers-ow...@lists.sourceforge.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Emc-developers digest..." > > > Today's Topics: > > 1. Re: Dynamically building a string for a varname? (gene heskett) > 2. Re: Dynamically building a string for a varname? (Andy Pugh) > > > -- > > Message: 1 > Date: Sat, 2 Mar 2024 07:32:51 -0500 > From: gene heskett > To: emc-developers@lists.sourceforge.net > Subject: Re: [Emc-developers] Dynamically building a string for a >varname? > Message-ID: > Content-Type: text/plain; charset="utf-8"; Format="flowed" > >> On 3/2/24 04:59, andy pugh wrote: >>> On Fri, 1 Mar 2024 at 23:38, gene heskett wrote: >>> >>> Well, I seem to be up to the first named subroutine call. But it cannot >>> find it. >> >> Drop the ".ngc" from the subroutine name in the .ngc fle. >> >> You have >> >> o sub >> > Didn't help, Andy. > I renamed tholefinder.ngc to tholefinder, fixed it internally, It is not > (most of the time) looking in the right place as specified in [RS@&$NGC] > SUBROUTINE_PATH in the .ini file. See attached screenshot. > Most of the time its looking in /tmp, /home/tmp (which doesn't exist, or > /home/gene/tmp which is apparently where its caching stuff. but NEVER > looks in /home/gene/linuxcnc/nc_files/subs/ which is where [RS274NGC} > SUBROUTINE_PATH = ~/linuxcnc/nc_files/subs point it at. > > Am I being dense? Or are you saying the files name still has the .ngc, > and the search adds that to the simplified name used in the parent file? > I'll try that but after some shoe-goo cures a while. After a decade the > glue holding the gear shift tally switches has given way so I had to > reglue that assembly before the spindle runs right. Takes about an hour. > > Thank you, take care & stay well. > > 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 > -- next part -- > A non-text attachment was scrubbed... > Name: Screenshot_20240302_061446.png > Type: image/png > Size: 15984 bytes > Desc: not available > > -- > > Message: 2 > Date: Sat, 2 Mar 2024 15:27:46 + > From: Andy Pugh > To: EMC developers > Subject: Re: [Emc-developers] Dynamically building a string for a >varname? > Message-ID: <420f2b54-d43d-43e8-b618-a8441ed03...@gmail.com> > Content-Type: text/plain; charset=us-ascii > > > >> On 2 Mar 2024, at 12:35, gene heskett wrote: >> >> I renamed tholefinder.ngc to tholefinder, > > Leave the filename the same. > Rename the subroutine inside that file. > Call it by the subroutine name. > > > > > -- > > > > -- > > Subject: Digest Footer > > ___ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > > > -- > > End of Emc-developers Digest, Vol 215, Issue 3 > ** ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Dynamically building a string for a varname?
> On 2 Mar 2024, at 12:35, gene heskett wrote: > > I renamed tholefinder.ngc to tholefinder, Leave the filename the same. Rename the subroutine inside that file. Call it by the subroutine name. ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Dynamically building a string for a varname?
On 3/2/24 04:59, andy pugh wrote: On Fri, 1 Mar 2024 at 23:38, gene heskett wrote: Well, I seem to be up to the first named subroutine call. But it cannot find it. Drop the ".ngc" from the subroutine name in the .ngc fle. You have o sub Didn't help, Andy. I renamed tholefinder.ngc to tholefinder, fixed it internally, It is not (most of the time) looking in the right place as specified in [RS@&$NGC] SUBROUTINE_PATH in the .ini file. See attached screenshot. Most of the time its looking in /tmp, /home/tmp (which doesn't exist, or /home/gene/tmp which is apparently where its caching stuff. but NEVER looks in /home/gene/linuxcnc/nc_files/subs/ which is where [RS274NGC} SUBROUTINE_PATH = ~/linuxcnc/nc_files/subs point it at. Am I being dense? Or are you saying the files name still has the .ngc, and the search adds that to the simplified name used in the parent file? I'll try that but after some shoe-goo cures a while. After a decade the glue holding the gear shift tally switches has given way so I had to reglue that assembly before the spindle runs right. Takes about an hour. Thank you, take care & stay well. 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 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers
Re: [Emc-developers] Dynamically building a string for a varname?
On Fri, 1 Mar 2024 at 23:38, gene heskett wrote: > Well, I seem to be up to the first named subroutine call. But it cannot > find it. Drop the ".ngc" from the subroutine name in the .ngc fle. You have o sub -- 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, 1912 ___ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers