Getting current gcode file name from Axis
09 Dec 2011 15:23 - 09 Dec 2011 15:28 #15513
by ArcEye
Getting current gcode file name from Axis was created by ArcEye
Hi,
This results from a thread where gois wanted a way of writing the current gcode file name to a work time logging report.
(www.linuxcnc.org/index.php/english/compo...ew&catid=38&id=15259)
It had to be usable in a Mcode script which was triggered from the gcode starting and finishing.
After finding an interim method of filling this requirement, I have made a more satisfactory and general alteration to Axis, which results in a file called /tmp/emc.filename being maintained.
When axis starts, this file will either contain "No File Loaded", or the name of the loaded file, if started with the file as a command-line argument, or an automatic opening from the .INI file etc.
Whenever a new file is loaded, this file will be updated to reflect the change.
The attached zip contains modified axis for 2.4.5, 2.4.7 and 2.6. If yours is a different version copy over the code as marked and listed in the header to it.
Also contains a sample M code script M121, which shows a use as a work time stamp file generator
Hopefully of use to some of you
regards
This results from a thread where gois wanted a way of writing the current gcode file name to a work time logging report.
(www.linuxcnc.org/index.php/english/compo...ew&catid=38&id=15259)
It had to be usable in a Mcode script which was triggered from the gcode starting and finishing.
After finding an interim method of filling this requirement, I have made a more satisfactory and general alteration to Axis, which results in a file called /tmp/emc.filename being maintained.
When axis starts, this file will either contain "No File Loaded", or the name of the loaded file, if started with the file as a command-line argument, or an automatic opening from the .INI file etc.
Whenever a new file is loaded, this file will be updated to reflect the change.
The attached zip contains modified axis for 2.4.5, 2.4.7 and 2.6. If yours is a different version copy over the code as marked and listed in the header to it.
Also contains a sample M code script M121, which shows a use as a work time stamp file generator
Hopefully of use to some of you
regards
Last edit: 09 Dec 2011 15:28 by ArcEye.
Please Log in or Create an account to join the conversation.
09 Dec 2011 15:29 #15515
by ArcEye
Replied by ArcEye on topic Re:Getting current gcode file name from Axis
Zip attached to this one!!
Please Log in or Create an account to join the conversation.
09 Dec 2011 16:13 #15517
by gois
Replied by gois on topic Re:Getting current gcode file name from Axis
All right, thank you "
Please Log in or Create an account to join the conversation.
Time to create page: 0.062 seconds