path of current active ngc-file (or calling ngc for remap M6)

More
18 Jan 2021 20:28 #195822 by freisei
Hi!

i have nearly finished auto tool-lenght measuring feature in probe-screen.
One of the last thing is that i want show some informations in the tool-change dialog that i can get from the NGC-file.

Is it possible to get the path/filename from inside g-code (especially from the M6-remap-code which is a ngc-macro). Or are there other possibilitys from external programs (which i could call by M-Codes)

Greets,
Freisei

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

More
19 Jan 2021 15:56 #195899 by andypugh
G-code has (almost) no string handling at all. So it's hard to think of a way to do that.

Where do you want to use the file name?

linuxcnc.status.file() returns the G-code file via the Python interface:
linuxcnc.org/docs/2.8/html/config/python-interface.html
The following user(s) said Thank You: freisei

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

More
19 Jan 2021 22:33 - 19 Jan 2021 22:46 #195929 by joekline9
I put :
(MSG, LOAD TOOL 1, Turn & face )
M6 T1 G43
...
It prints on the bottom right of the AXIS GUI
It is not in the manual tool change box but still useful.
You can put any text in the (MSG, text...)
Also see:
(PRINT,...)
(DEBUG,...)
Print can output variables.
Last edit: 19 Jan 2021 22:46 by joekline9.

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

More
19 Jan 2021 22:41 #195932 by andypugh
If you use (DEBUG. parameter1 = #1 parameter 2 = #2) then it will print the numerical values of parameters.

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

More
20 Jan 2021 09:07 #195980 by freisei
thats exacly what i need! Thank you!

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

More
20 Jan 2021 14:01 #195992 by freisei
btw in remapped code with ngc the linuxcnc.status.file() shows only the remap-file. Of course i need the calling file. For now i use the change_prolog to store the filename in a separate file and load/use this file in the remap-code by a custom m-call.

Maybe there is a better way to store the filename (maybe in linuxcnc.status-object?). If someone knows, let me know too.

Greets,
Freisei

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

Time to create page: 0.087 seconds
Powered by Kunena Forum