Mcode out of range, greater than 199 error
- Lcvette
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 1246
- Thank you received: 634
26 Dec 2024 14:44 #317407
by Lcvette
Mcode out of range, greater than 199 error was created by Lcvette
Is anyone else getting out of range mcode errors? Getting these from time to time while tinkering in 5 axis switchkins builds on calls for the higher m codes.
Please Log in or Create an account to join the conversation.
- pd_2832
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
03 Jan 2025 12:54 - 03 Jan 2025 12:56 #317924
by pd_2832
Replied by pd_2832 on topic Mcode out of range, greater than 199 error
Yes, I’ve also been encountering this type of error while adding custom logic in the INI file for my double Z CNC machine. I experienced the "out of range M-code" issue when working with higher M-codes. To resolve it, I attempted remapping the M428 code to T in the configuration file, which seemed to help in certain cases. It might be related to how the M-codes are being interpreted by the machine’s controller, so adjusting the logic or reassigning the codes can sometimes fix the problem. Has anyone else had success with a similar approach or found a better solution?
Last edit: 03 Jan 2025 12:56 by pd_2832.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1840
- Thank you received: 745
03 Jan 2025 13:35 #317926
by spumco
Replied by spumco on topic Mcode out of range, greater than 199 error
Same here.
I've cooked up a bunch of m-codes for my in-progress lathe and I had to do a remap for any >199.
So 100-199 are 'normal' M-codes in an "MCODES" folder, and 200+ are mNNN.ngc files in a "subroutines" folder.
I've cooked up a bunch of m-codes for my in-progress lathe and I had to do a remap for any >199.
So 100-199 are 'normal' M-codes in an "MCODES" folder, and 200+ are mNNN.ngc files in a "subroutines" folder.
Please Log in or Create an account to join the conversation.
- pd_2832
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
04 Jan 2025 10:09 #318033
by pd_2832
Replied by pd_2832 on topic Mcode out of range, greater than 199 error
do have work multihead cnc project ? @spumco !!
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 4034
- Thank you received: 1741
04 Jan 2025 12:12 #318053
by Aciera
Replied by Aciera on topic Mcode out of range, greater than 199 error
This would indicate that the remap has not been setup correctly. Could you guys post your ini files that cause this error please?
Please Log in or Create an account to join the conversation.
- Lcvette
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 1246
- Thank you received: 634
04 Jan 2025 14:51 #318077
by Lcvette
Replied by Lcvette on topic Mcode out of range, greater than 199 error
using the switchkins example ini settings and sub files. my config is an experimental setup in a work in progress branch in probe basic for multi axis simulation. not sure you would want to dissect through that to hunt down the issue, but here is the github link to the branch if you do!
Chris
github.com/kcjengr/probe_basic/tree/simu...figs/probe_basic_asm
Chris
github.com/kcjengr/probe_basic/tree/simu...figs/probe_basic_asm
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 4034
- Thank you received: 1741
04 Jan 2025 15:07 - 04 Jan 2025 15:09 #318082
by Aciera
Replied by Aciera on topic Mcode out of range, greater than 199 error
Changed to AxisGUI (as I don't know how to set up Probe_Basic) and commented out the POSTGUI_HALFILE (as I got start up errors about missing hal pins) then tested in current master on a non-rt RIP installation. Seems to work fine for me.
Last edit: 04 Jan 2025 15:09 by Aciera.
Please Log in or Create an account to join the conversation.
- Lcvette
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 1246
- Thank you received: 634
04 Jan 2025 15:40 #318088
by Lcvette
Replied by Lcvette on topic Mcode out of range, greater than 199 error
i got the errors when trying to test some of the included files from that switchkins test branch
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
Less
More
- Posts: 1840
- Thank you received: 745
04 Jan 2025 16:04 #318093
by spumco
The error only occurs when I don't remap m-codes higher than 199. If you don't remap, then LCNC's standard user m-code range is 100-199, using capital "M" and no file extension.
Using remap and mxxx.ngc permits an essentially unlimited number of m-codes. I get no errors with my remap:
This works fine for me (combo of user m-codes and remapped mcodes)
Replied by spumco on topic Mcode out of range, greater than 199 error
Aciera,This would indicate that the remap has not been setup correctly. Could you guys post your ini files that cause this error please?
The error only occurs when I don't remap m-codes higher than 199. If you don't remap, then LCNC's standard user m-code range is 100-199, using capital "M" and no file extension.
Using remap and mxxx.ngc permits an essentially unlimited number of m-codes. I get no errors with my remap:
This works fine for me (combo of user m-codes and remapped mcodes)
[RS274NGC]
PARAMETER_FILE = lathe.var
USER_M_PATH = /home/lathe/linuxcnc/configs/LATHE_REV1.70/MCODES/
SUBROUTINE_PATH = /home/lathe/linuxcnc/configs/LATHE_REV1.70/subroutines
RS274NGC_STARTUP_CODE = F10 S0 G7 G18 G20 G40 G49 G54 G64 P0.001 G80 G90 G91.1 G92.1 G94 G97 G98
;ORIENT_OFFSET =
#REMAP=G12.1 ngc=g121
#REMAP=G13.1 ngc=g131
REMAP=M200 modalgroup=10 ngc=m200
REMAP=M201 modalgroup=10 ngc=m201
REMAP=M202 modalgroup=10 ngc=m202
REMAP=M203 modalgroup=10 ngc=m203
REMAP=M210 modalgroup=10 ngc=m210
REMAP=M211 modalgroup=10 ngc=m211
REMAP=M212 modalgroup=10 ngc=m212
REMAP=M213 modalgroup=10 ngc=m213
REMAP=M220 modalgroup=10 ngc=m220
REMAP=M221 modalgroup=10 ngc=m221
REMAP=M222 modalgroup=10 ngc=m222
REMAP=M223 modalgroup=10 ngc=m223
REMAP=M268 modalgroup=10 ngc=m268
REMAP=M269 modalgroup=10 ngc=m269
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 4034
- Thank you received: 1741
04 Jan 2025 16:05 - 04 Jan 2025 16:09 #318094
by Aciera
Replied by Aciera on topic Mcode out of range, greater than 199 error
@Lcvette
Do you get the same errors when running the switchkins sim configs that are included in the standard Linuxcnc installation?
Do you get the same errors when running the switchkins sim configs that are included in the standard Linuxcnc installation?
Last edit: 04 Jan 2025 16:09 by Aciera.
Please Log in or Create an account to join the conversation.
Time to create page: 0.073 seconds