- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- on_abort macro not found when code is encapsulated in %
on_abort macro not found when code is encapsulated in %
11 Nov 2020 14:54 #189005
by mydani
on_abort macro not found when code is encapsulated in % was created by mydani
Hello,
my postprocessor generates a % as first and last line of gcode - background is, I want to keep the settings used in GCODE, e.g. work coordinate offset, G95, G96, etc. Unfortunately, when I load a file like this and then press escape, my "on_abort" macro is not found anymore. If I load another file which has M2/M30 and no %, on pressing escape the "on_abort" macro is executed.
Do you have any hints?
Regards,
Daniel
my postprocessor generates a % as first and last line of gcode - background is, I want to keep the settings used in GCODE, e.g. work coordinate offset, G95, G96, etc. Unfortunately, when I load a file like this and then press escape, my "on_abort" macro is not found anymore. If I load another file which has M2/M30 and no %, on pressing escape the "on_abort" macro is executed.
Do you have any hints?
Regards,
Daniel
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 18831
- Thank you received: 6326
11 Nov 2020 15:25 #189010
by tommylight
Replied by tommylight on topic on_abort macro not found when code is encapsulated in %
What CAM ?
Please Log in or Create an account to join the conversation.
11 Nov 2020 15:34 #189011
by mydani
Replied by mydani on topic on_abort macro not found when code is encapsulated in %
Even without CAM, just by writing the code manually, this happens.
%
G59
... do some milling here ...
M5
M9
%
%
G59
... do some milling here ...
M5
M9
%
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 18831
- Thank you received: 6326
11 Nov 2020 17:41 #189019
by tommylight
Replied by tommylight on topic on_abort macro not found when code is encapsulated in %
I asked what CAM software you are using to generate gcode.
Anyway, use % or M2 or both, but since % causes issues, use only M2 at the end.
Anyway, use % or M2 or both, but since % causes issues, use only M2 at the end.
Please Log in or Create an account to join the conversation.
11 Nov 2020 17:50 #189020
by mydani
Replied by mydani on topic on_abort macro not found when code is encapsulated in %
InventorHSM. But of course manipulated by me to not post M2.
In the documentation it says:
It is unclear whether the M2 would be executed if there is a % at beginning and before the M2 at the end.
I will try tomorrow and find out.
Regards,
Daniel
In the documentation it says:
A G code file must contain one or more lines of G code and be terminated with a Program End. Any G code past the program end is not evaluated.
If a program end code is not used a pair of percent signs % with the first percent sign on the first line of the file followed by one or more lines of G code and a second percent sign. Any code past the second percent sign is not evaluated.
Warning
Using % to wrap a G code file will not do the same thing as using a program end. The machine will be in what ever state the program left it in using %, the spindle and coolant may still be on and things like G90/91 are left as the last program set them. If you don’t use a proper preamble the next program could start in a dangerous condition.
It is unclear whether the M2 would be executed if there is a % at beginning and before the M2 at the end.
I will try tomorrow and find out.
Regards,
Daniel
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- on_abort macro not found when code is encapsulated in %
Time to create page: 0.060 seconds