Help with Macros (On_Abort.ngc

More
7 years 8 months ago #126735 by MartyJ
Based on the docs here , I have the following:

on_abort.ngc is in my config folder /macros
Code:
% o<on_abort> sub G28 Z0.0 o<on_abort> endsub m2 %

This is in my INI:
Code:
[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?

Please Log in to join the conversation.

More
7 years 8 months ago #126737 by tommylight
Did not test it but i think this:
Code:
[RS274NGC] PARAMETER_FILE = linuxcnc.var ON_ABORT_COMMAND=O <on_abort> call SUBROUTINE_PATH = macros
Should be this:
Code:
[RS274NGC] PARAMETER_FILE = linuxcnc.var ON_ABORT_COMMAND=O <on_abort> call SUBROUTINE_PATH = /macros
Notice the slash before macros.

Please Log in to join the conversation.

More
7 years 8 months ago #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"

Please Log in to join the conversation.

More
7 years 8 months ago #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 to join the conversation.

More
7 years 8 months ago #127188 by andypugh

MartyJ wrote: 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 to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum