Failure to find Named Subroutines
- roycegb
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
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.
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.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 21134
- Thank you received: 7220
09 Jan 2026 20:55 #341220
by tommylight
-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
Replied by tommylight on topic Failure to find Named Subroutines
No idea if this is the issue, but easy to test so:
In this case I had a dead simple routine named 'test.ngc' that called a dead simple subroutine named 'my file.ngc'.
-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.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 496
- Thank you received: 210
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
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