Help with Macros (On_Abort.ngc

More
18 Feb 2019 23:54 - 18 Feb 2019 23:54 #126735 by MartyJ
Based on the docs here , I have the following:

on_abort.ngc is in my config folder /macros
%
o<on_abort> sub


G28 Z0.0

o<on_abort> endsub
m2
%

This is in my INI:
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
ON_ABORT_COMMAND=O <on_abort> call
SUBROUTINE_PATH = macros

Basically I want to retract Z on abort.

What I get is on_abort attempting to run continuously, interrupting the interface and unable to home because of errors thrown by continuously trying to run on_abort.ngc

Any ideas where I went wrong?
Attachments:
Last edit: 18 Feb 2019 23:54 by MartyJ.

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

More
19 Feb 2019 00:28 #126737 by tommylight
Did not test it but i think this:
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
ON_ABORT_COMMAND=O <on_abort> call
SUBROUTINE_PATH = macros
Should be this:
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
ON_ABORT_COMMAND=O <on_abort> call
SUBROUTINE_PATH = /macros
Notice the slash before macros.

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

More
19 Feb 2019 00:36 - 19 Feb 2019 00:39 #126738 by MartyJ
Nice catch. Now it no longer gives errors continuously. Instead it says, "File Not Open". The machine can be homed, it throws occasional "File Not Open" warnings, but doesn't execute the G28 command.

When I run a program and abort it, it says "EOF in file:/(pathtogcodefile)/gcode.ngc seeking o-word: o<on_abort> from line:453"
Last edit: 19 Feb 2019 00:39 by MartyJ.

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

More
19 Feb 2019 00:49 #126741 by MartyJ
Thinking about it, all I really need is this.

ON_ABORT_COMMAND=G28 z0.0

Is that a valid usage?

When I try it, I get a "Bad Character '[' used" error.

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

More
26 Feb 2019 20:58 #127188 by andypugh

When I run a program and abort it, it says "EOF in file:/(pathtogcodefile)/gcode.ngc seeking o-word: o<on_abort> from line:453"


A (rather unexpected) cause of that error is if both the subroutine file and the loaded G-code file have % as top and bottom.

If the subroutine file is %-delimited then try removing them.

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

Time to create page: 0.132 seconds
Powered by Kunena Forum