What's wrong with this subroutine file and why does it report "file not open"?

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
13 Oct 2020 07:51 #185935 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.
; 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
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
13 Oct 2020 08:08 #185939 by JetForMe
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.

More
13 Oct 2020 11:00 #185964 by phillc54

Seems it doesn't like `probeZ` (perhaps the capital Z?). If I call it `pz`, it works.

Yes, that is correct:
linuxcnc.org/docs/html/gcode/o-code.html#ocode:calling-files

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

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
14 Oct 2020 00:24 #186044 by JetForMe
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.

More
14 Oct 2020 11:41 #186087 by andypugh
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.
The following user(s) said Thank You: JetForMe

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

  • JetForMe
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
20 Oct 2020 05:40 #186652 by JetForMe
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
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
20 Oct 2020 07:47 #186659 by rodw

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
  • JetForMe's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
20 Oct 2020 07:59 #186660 by JetForMe
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
  • rodw's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
20 Oct 2020 08:37 #186661 by rodw

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.

Time to create page: 0.077 seconds
Powered by Kunena Forum