- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- What's wrong with this subroutine file and why does it report "file not open"?
What's wrong with this subroutine file and why does it report "file not open"?
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
13 Oct 2020 07:51 #185935
by JetForMe
What's wrong with this subroutine file and why does it report "file not open"? was created by JetForMe
I have this file in my `nc_subroutines` directory. The path is set correctly. None of the files in that directory have execute permissions set. Nevertheless, Axis can find the other files, but not this one. When I try to call this from the MDI, it throws up an error "File not open."
I'm trying to call it with `O<probeZ> call`.
I can call another file in the directory with `O<restore> call` and it doesn't complain.
I'm trying to call it with `O<probeZ> call`.
I can call another file in the directory with `O<restore> call` and it doesn't complain.
; Probe for toolsetter in z
; call as 'O<probeZ> call
;
O<probeZ> sub
G49
G91
G38.2 F200 Z-90
G1 F1000 Z3
G38.2 F50 Z-5
#<_ToolRefZ> = #5063
(print,new length is #5063)
G1 F1000 Z10
G90
O<probeZ> endsub
m2
Please Log in or Create an account to join the conversation.
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
13 Oct 2020 08:08 #185939
by JetForMe
Replied by JetForMe on topic What's wrong with this subroutine file and why does it report "file not open"?
Seems it doesn't like `probeZ` (perhaps the capital Z?). If I call it `pz`, it works.
Please Log in or Create an account to join the conversation.
- phillc54
- Offline
- Platinum Member
Less
More
- Posts: 5697
- Thank you received: 2081
13 Oct 2020 11:00 #185964
by phillc54
linuxcnc.org/docs/html/gcode/o-code.html#ocode:calling-files
Replied by phillc54 on topic What's wrong with this subroutine file and why does it report "file not open"?
Yes, that is correct:Seems it doesn't like `probeZ` (perhaps the capital Z?). If I call it `pz`, it works.
linuxcnc.org/docs/html/gcode/o-code.html#ocode:calling-files
Please Log in or Create an account to join the conversation.
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
14 Oct 2020 00:24 #186044
by JetForMe
Replied by JetForMe on topic What's wrong with this subroutine file and why does it report "file not open"?
Ugh. Be nice if it didn't have such arbitrary restrictions, and if absolutely necessary, some better error reporting.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23538
- Thank you received: 4854
14 Oct 2020 11:41 #186087
by andypugh
Replied by andypugh on topic What's wrong with this subroutine file and why does it report "file not open"?
The problem is that there is no upper/lower case in G-code. This is only noticable when it interacts with the file system, which does make a distinction.
Your sub would _probably_ work if you just lowercased the filename.
Your sub would _probably_ work if you just lowercased the filename.
The following user(s) said Thank You: JetForMe
Please Log in or Create an account to join the conversation.
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
20 Oct 2020 05:40 #186652
by JetForMe
Replied by JetForMe on topic What's wrong with this subroutine file and why does it report "file not open"?
I suppose LinuxCNC could enumerate the directory and just lowercase everything when looking for the file.
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
Less
More
- Posts: 10715
- Thank you received: 3534
20 Oct 2020 07:47 #186659
by rodw
But Linux has always been case sensitive. Time to leave your Windows habits behind!
Replied by rodw on topic What's wrong with this subroutine file and why does it report "file not open"?
I suppose LinuxCNC could enumerate the directory and just lowercase everything when looking for the file.
But Linux has always been case sensitive. Time to leave your Windows habits behind!
Please Log in or Create an account to join the conversation.
- JetForMe
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 305
- Thank you received: 16
20 Oct 2020 07:59 #186660
by JetForMe
Replied by JetForMe on topic What's wrong with this subroutine file and why does it report "file not open"?
I don't use Windows. If G-code is case-insensitive, then LinuxCNC needs to match without regard to case.
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
Less
More
- Posts: 10715
- Thank you received: 3534
20 Oct 2020 08:37 #186661
by rodw
If you don't use windows, then you will be familiar with the Linux way of doing file names.
A bit unrealistic for an application to attempt to override the operating system I think. The application needs to match the OS when it comes to file names. It would not be trivial to code what you suggest given the permutations with case on every letter of the file name and extend it to folder names.
Replied by rodw on topic What's wrong with this subroutine file and why does it report "file not open"?
I don't use Windows. If G-code is case-insensitive, then LinuxCNC needs to match without regard to case.
If you don't use windows, then you will be familiar with the Linux way of doing file names.
A bit unrealistic for an application to attempt to override the operating system I think. The application needs to match the OS when it comes to file names. It would not be trivial to code what you suggest given the permutations with case on every letter of the file name and extend it to folder names.
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- What's wrong with this subroutine file and why does it report "file not open"?
Time to create page: 0.077 seconds