Write M code

More
07 Jul 2021 09:18 #213950 by chen1234
Write M code was created by chen1234
Hi!
I want to customize an M code, I read linuxcnc.org/docs/2.8/html/gcode/m-code.html#mcode:m70, but I still don’t know how to write it.

Thanks in advance,
Chen1234

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

More
07 Jul 2021 09:43 #213953 by andypugh
Replied by andypugh on topic Write M code
I don't really understand the question.

Do you want to customise M70? Or do you want to write a new M-code that uses M70?

Can we start at a higher level: What do you want the customised M-code to do?

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

More
07 Jul 2021 09:53 #213955 by chen1234
Replied by chen1234 on topic 编写 M 代码
I want to define a new M code through M100-M199 to realize the function of controlling the laser, but I don’t know how to write the M code

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

More
07 Jul 2021 10:19 #213956 by Aciera
Replied by Aciera on topic 编写 M 代码
Please don't double post. You already opened a thread here:

forum.linuxcnc.org/20-g-code/42992-how-t...cognized-by-linuxcnc

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

More
11 Jul 2021 01:28 #214226 by chen1234
Replied by chen1234 on topic Write M code
I want to define a new M code through M100-M199 to realize the function of controlling the laser, but I don’t know how to write the M code

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

More
11 Jul 2021 23:13 #214340 by andypugh
Replied by andypugh on topic Write M code
What does the M-code need to do? You keep asking the same question, but you are not giving us enough information to give an answer.

linuxcnc.org/docs/2.8/html/gcode/m-code.html#mcode:m100-m199

(Sorry, but only parts of the LinuxCNC documentation have been translated to Chinese. If you want to submit a translation of the G-code pages, that would be excellent)

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

More
12 Jul 2021 01:24 #214345 by chen1234
Replied by chen1234 on topic Write M code
I need to add M code to control the turning on or off of the laser. I have not contacted linuxcnc before and want to know how to write or run a correct M code

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

More
12 Jul 2021 08:22 #214371 by andypugh
Replied by andypugh on topic Write M code
The collet-closer M-code in the examples linked above should work if all you need to do is turn a GPIO pin on and off.

Or, you could use the existing coolant output pins (I doubt that a laser uses "mist coolant") and then use M7 / M9.
The following user(s) said Thank You: chen1234

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

More
15 Sep 2021 04:02 #220668 by plewis
Replied by plewis on topic Write M code
Hi, I'm very new to linuxcnc and this forum, so forgive me if this is easy to answer from the documentation. I'm working to build a hybrid 3D printer for metals (DED+CNC) and I'm trying to better understand what custom M code can do. Our printer will have a CNC spindle as well as a laser head mounted together. The laser is controlled using a simple ethernet interface. The laser will be plugged into a router with the desktop and MESA hardware. Is it possible to create an M-code that can be called from LinuxCNC that will allow for ethernet communications with the laser controller? As far as I can tell I can assign an unused M code to run a python function and have two parameters that can be passed. Are there any limitations on this that would prevent me from using ethernet to talk to the laser?
Thank you in advance.

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

Time to create page: 0.116 seconds
Powered by Kunena Forum