M codes

More
15 years 6 months ago #9308 by andradela
M codes was created by andradela
Hello guys, how do I create a new M codes to use with a classic ladder like a M10,M12...

Please Log in to join the conversation.

More
15 years 6 months ago #9316 by BigJohnT
Replied by BigJohnT on topic Re:M codes
You have to change the EMC program.

John

Please Log in to join the conversation.

More
15 years 6 months ago #9327 by andypugh
Replied by andypugh on topic Re:M codes
Redefining G and M codes is an experimental feature in the 2.6 branch.

Can you run the G-code through a text editor to replace M10 with M110? (the M100 to M199 codes are already user-definable)

Please Log in to join the conversation.

More
15 years 6 months ago #9349 by andradela
Replied by andradela on topic Re:M codes
Ok i can do it, but I need to associate M110 to output 7 to use with a automatic tool change.

Please Log in to join the conversation.

More
15 years 6 months ago #9351 by andypugh
Replied by andypugh on topic Re:M codes
andradela wrote:

Ok i can do it, but I need to associate M110 to output 7 to use with a automatic tool change.


That's relatively easy.

You need to file called M110 in your program_prefix directory (ie the one referenced in the INI file) and that file needs to contain the
Code:
#!bin/bash halcmd setp parport.0.pin-07-out TRUE exit 0
And that should do it (assuming a parallel port)

Please Log in to join the conversation.

More
15 years 6 months ago #9352 by andradela
Replied by andradela on topic Re:M codes
I'm using 7i43 mesa card i can do this way?

Please Log in to join the conversation.

More
15 years 6 months ago #9353 by andypugh
Replied by andypugh on topic Re:M codes
andradela wrote:

I'm using 7i43 mesa card i can do this way?

Yes, no problem.
Assuming that the pin in question has been set as an output gpio…
Code:
#!bin/bash halcmd setp hm2_7i43.0.gpio.009.out TRUE exit 0

Please Log in to join the conversation.

More
15 years 6 months ago #9360 by andradela
Replied by andradela on topic Re:M codes
ok, I need to creat a new file and write this inside is correct?
What kind of extension I need to use when i'll create a new file, doc, txt, py?

Please Log in to join the conversation.

More
15 years 6 months ago #9366 by andypugh
Replied by andypugh on topic Re:M codes
No extension. it needs to be made executable though. (it is run as a shell command).

When you have created the file then in the terminal window type
chmod 775 M110

Please Log in to join the conversation.

More
15 years 6 months ago #9371 by BigJohnT
Replied by BigJohnT on topic Re:M codes
If your not familiar with using the terminal you might want to just right click on the file in the file browser and set the permission to allow it to be an executable file.

If you want to use the terminal and don't know much about it then have a short read here:

www.linuxcnc.org/docview/html/common_Lin...ec:Terminal-Commands

John

Please Log in to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum