REMAP Mcode seemingly ignored
- NT4Boy
- Offline
- Premium Member
-
Less
More
- Posts: 146
- Thank you received: 13
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
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.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 510
- Thank you received: 216
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
eg.
M66 E0 L0
M169 P9
M66 E0 L0
M169 P6
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- NT4Boy
- Offline
- Premium Member
-
Less
More
- Posts: 146
- Thank you received: 13
28 Feb 2026 17:40 #343662
by NT4Boy
Replied by NT4Boy on topic REMAP Mcode seemingly ignored
I think that's a good thought, however, I've found M19 is not available to directly remap according to
this
.
14.1. Existing codes which can be remapped
The current set of existing codes open to redefinition is:
Tx (Prepare)
M6 (Change tool)
M61 (Set tool number)
M0 (pause a running program temporarily)
M1 (pause a running program temporarily if the optional stop switch is on)
M60 (exchange pallet shuttles and then pause a running program temporarily)
S (set spindle speed)
F (set feed)
14.1. Existing codes which can be remapped
The current set of existing codes open to redefinition is:
Tx (Prepare)
M6 (Change tool)
M61 (Set tool number)
M0 (pause a running program temporarily)
M1 (pause a running program temporarily if the optional stop switch is on)
M60 (exchange pallet shuttles and then pause a running program temporarily)
S (set spindle speed)
F (set feed)
Please Log in or Create an account to join the conversation.
Time to create page: 0.100 seconds