M106 remap to M67

More
5 years 2 weeks ago #223373 by ericg
Replied by ericg on topic M106 remap to M67
has this been resolved? I ask because I would also like to remap Lightburn code but wondered if it is possible to remap depending on the S value.
What I would like is that M106 S0 be remapped to M68 E0 Q0 and M106 S500 be remapped to M67 E0 Q(#<S>/1000),
I have tried reading the remap documents but it's a bit confusing for me at this stage.
Maybe one day Lightburn will have the option to do this in their PP.
thanks
Eric

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

More
5 years 1 week ago #223839 by andypugh
Replied by andypugh on topic M106 remap to M67
I am not sure that you can remap M106. That is in the M100-M199 range that is used for a traditional mode of custom command.
(And, as M100 and friends run an external execuatable I doubt that realtime performance is preserved)

The docs say "All M-codes from M100 to M199 are user-defined M-codes already, and should not be remapped." But if I were you I might be tempted to try it to see what actually happens.

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

More
5 years 1 week ago #223840 by ericg
Replied by ericg on topic M106 remap to M67
Thanks for the response Andy, I did read that so not sure if it would work either, but I made a work around by creating a bash script with 2 sed commands (been ages since I did any bash scripting)
FYI or anyone else reading this my bash script is
#!/bin/bash
sed -i 's/M106 S0/G68 E0 Q0/g' $1
sed -i 's/M106 S/G67 E0 Q/g' $1
I saved it as RunSED (no imagination)
made it executable chmod +x RunSED
and then run it with ./RunSED 'filename'
seems to work OK
Eric

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

More
5 years 1 week ago #223849 by andypugh
Replied by andypugh on topic M106 remap to M67
You can configure LinuxCNC to automatically run files through the filter before executing them.
linuxcnc.org/docs/2.8/html/config/ini-co...html#_filter_section

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

More
5 years 1 week ago #223871 by ericg
Replied by ericg on topic M106 remap to M67
Thanks, good thought, I have played with that before so will give it a go soon.

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

Time to create page: 0.358 seconds
Powered by Kunena Forum