User defined M-codes Vs. M62-M65

More
7 years 1 month ago #146756 by Scot
So in my quest for getting that collet open, I found in the Mcode section that there are 4 Mcodes that are digital outputs. Two attached to motion, M62 turns the output on and M63 turns it off. Two unattached to motion, M64/on and M65/off. I'm sure the unattached M64 and M65 could be used for this collet thing I'm doing. And I'm pretty sure since they're unattached to particular outputs and out of the box with LinuxCNC I can use them. But I don't know how to apply them to my setup and Jon was unaware of them until last night. You can find them here:

linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m62-m65

I have no qualms working with either the user defined Mcodes or this set up. But as par for my course, I'm not informed enough to make a good decision, yet.

Any light to be shed on this part?

Please Log in to join the conversation.

More
7 years 1 month ago #146757 by bevins

Scot wrote: So in my quest for getting that collet open, I found in the Mcode section that there are 4 Mcodes that are digital outputs. Two attached to motion, M62 turns the output on and M63 turns it off. Two unattached to motion, M64/on and M65/off. I'm sure the unattached M64 and M65 could be used for this collet thing I'm doing. And I'm pretty sure since they're unattached to particular outputs and out of the box with LinuxCNC I can use them. But I don't know how to apply them to my setup and Jon was unaware of them until last night. You can find them here:

linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m62-m65

I have no qualms working with either the user defined Mcodes or this set up. But as par for my course, I'm not informed enough to make a good decision, yet.

Any light to be shed on this part?


What are you trying to do?
Both will work.

Please Log in to join the conversation.

More
7 years 1 month ago #146758 by Scot
Well ultimately I'm trying to learn how to use either in what ever application I need. But currently I'm trying to open and close a collet, using an SSR socket on Pico-systems PWM board. The socket(s) I want to use are wired and appear properly so. But I'm not very versed in code.

I've been getting close with the user defined Mcodes, but I think there is a code issue that I'm not seeing <because I'm not that versed in inuxcnc>. Waiting on Jon to find out what I may be missing.

Either way is fine with me. I'm just seeing as many options as I can identify while trying to make the user defined option work.

Scot

Please Log in to join the conversation.

More
7 years 1 month ago #146761 by Todd Zuercher
It is kind of 6 of one half a dozen of the other. Two different ways to change the value of a hal pin. Both will work equally well.

Please Log in to join the conversation.

More
7 years 1 month ago #146765 by bevins
This is what I do:
Code:
In the ini file: REMAP= M200 modalgroup=10 ngc=m200 #raise spindle drill & spindle In subroutine folder in the m200.ngc file o<m200> sub M64P54 M64P16 M64P17 M64P18 M64P19 o<m200> endsub M2

So when you encounter a m200 in the gcode it will fire those outputs.

You need to set motion-digital-out-XX first in hal.

That's the way I do it. Should work for you also.

Please Log in to join the conversation.

More
7 years 1 month ago #146774 by BigJohnT
All of the digital I/O is for your use, the ones synchronized with motion are just that the fire when the next line of code is executed.

I would use M100-199 for a collet.

JT

Please Log in to join the conversation.

Time to create page: 0.129 seconds
Powered by Kunena Forum