Failure to find Named Subroutines

More
09 Jan 2026 20:44 #341219 by roycegb
Failure to find Named Subroutines was created 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.
Attachments:

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
09 Jan 2026 20:55 #341220 by tommylight
Replied by tommylight on topic Failure to find Named Subroutines


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
09 Jan 2026 22:09 #341222 by MaHa
Replied by MaHa on topic Failure to find Named Subroutines
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.

Time to create page: 0.058 seconds
Powered by Kunena Forum