REMAP Mcode seemingly ignored

More
25 Feb 2026 15:32 #343470 by NT4Boy
REMAP Mcode seemingly ignored was created by NT4Boy
Hi.
I've added a custom M199 code to enable my  spindle-index-enable signal, and this runs fine. (Can see the LED light up in halshow when run.)
So now I'd like to build it into my M19, so the M99 runs just before the M19 is called.

In the [RS274NGC] section of my INI, I have put
REMAP=M19  modalgroup=7  argspec=RQP ngc=custom_M19
my custom_R19.ngc file contains:-
( Custom spindle orientation ngc file)
( M199 raise spindle-index-enable signal)
o<pre_M19>sub
M5
M199
G4 P2
M19 R#<r> Q#<q> P#<p>
o<pre_M19>endsub

The G4 pause is just so I can be sure that the signal is enabled in halshow gui.

I'm pretty sure the file is being read at Linuxcnc fire up, as when I remove the file from the macros folder, the startup parser errors with missing file.

After I home the machine and run the MDI command say M19 R20, the M199 and the pause are not being executed.

I feel I have missed something really obvious..  be grateful for a steer. Thanks

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

More
25 Feb 2026 16:45 #343477 by MaHa
Replied by MaHa on topic REMAP Mcode seemingly ignored
When working with multiple m codes, i always use Queue Buster before each m-code.
eg.

M66 E0 L0
M169 P9

M66 E0 L0
M169 P6
 

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

Time to create page: 0.070 seconds
Powered by Kunena Forum