User defined M-codes Vs. M62-M65
- Scot
- Offline
- Elite Member
Less
More
- Posts: 170
- Thank you received: 5
30 Sep 2019 20:03 #146756
by Scot
User defined M-codes Vs. M62-M65 was created 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?
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 or Create an account to join the conversation.
- bevins
- Offline
- Platinum Member
Less
More
- Posts: 1937
- Thank you received: 335
30 Sep 2019 20:07 #146757
by bevins
What are you trying to do?
Both will work.
Replied by bevins on topic User defined M-codes Vs. M62-M65
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 or Create an account to join the conversation.
- Scot
- Offline
- Elite Member
Less
More
- Posts: 170
- Thank you received: 5
30 Sep 2019 20:16 #146758
by Scot
Replied by Scot on topic User defined M-codes Vs. M62-M65
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
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 or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
30 Sep 2019 20:18 #146761
by Todd Zuercher
Replied by Todd Zuercher on topic User defined M-codes Vs. M62-M65
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.
The following user(s) said Thank You: Scot
Please Log in or Create an account to join the conversation.
- bevins
- Offline
- Platinum Member
Less
More
- Posts: 1937
- Thank you received: 335
30 Sep 2019 20:31 #146765
by bevins
Replied by bevins on topic User defined M-codes Vs. M62-M65
This is what I do:
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.
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.
The following user(s) said Thank You: Scot
Please Log in or Create an account to join the conversation.
- BigJohnT
- Offline
- Administrator
Less
More
- Posts: 7000
- Thank you received: 1172
30 Sep 2019 23:04 #146774
by BigJohnT
Replied by BigJohnT on topic User defined M-codes Vs. M62-M65
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
I would use M100-199 for a collet.
JT
Please Log in or Create an account to join the conversation.
Time to create page: 0.065 seconds