Failure to find Named Subroutines

More
9 months 3 weeks ago #341219 by roycegb
I have always had problems with named subroutines but lately I cannot get them to work at all.I get the following message;

LinuxCNC Error Near line 4 of/home/rpi-first-boot-wizard/linuxcnc/nc_files/Utility_G_Code/test.ngc:Failed to find sub 'Omyfile.ngc' before EOF

In this case I had a dead simple routine named 'test.ngc' that called a dead simple subroutine named 'my file.ngc'.

The location of the files and subroutines was called out in the .init file.

I have used named subroutines in the past.  I now use Raspberry Pi 4 and 5 with Axis 2.9.4 versions.

Any fool proof method for handling these subroutines would be appreciated.
I have a boat load of specializedsub routines lying dormant.

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #341220 by tommylight


In this case I had a dead simple routine named 'test.ngc' that called a dead simple subroutine named 'my file.ngc'.
No idea if this is the issue, but easy to test so:
-no spaces in file names, this was an issue way back, not sure if it still is
-use a file name like: my_file.ngc

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #341222 by MaHa
The name must always match

file:
myfile.ngc

in the subroutine:
o<myfile> sub
  some code
o<myfile> endsub

call the sub:
o<myfile> call
 
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #341249 by roycegb
tommylight;
The space in the original post was a typo. my file.ngc, no spaces.

MaHa;
I tied identical names with and without the .ngc suffix everywhere with no luck.

The attachment shows the result with all data shown as suggested.

I am suspicious that the program seems to be looking for 'Omyfile'   instead of simply O  'myfile'.  Could it be a parsing problem?

Thanks,
Royce

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #341250 by MaHa
The percent sign %  in the calling routine could cause that error. Capital letters for the naming in the routine, maybe too

Please Log in or Create an account to join the conversation.

More
9 months 3 weeks ago #341253 by tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.367 seconds
Powered by Kunena Forum