- LinuxCNC
- General LinuxCNC Questions
- Commands in LinuxCNC to control specific pins of the DB25 connector.....
Commands in LinuxCNC to control specific pins of the DB25 connector.....
- sd3534
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
23 Mar 2022 19:02 #238127
by sd3534
Commands in LinuxCNC to control specific pins of the DB25 connector..... was created by sd3534
Good Day:
I did a search and really didn't find anything regarding commands to turn on specific pins of the DB25 connector.
I did find configuration files references for specific boards but I don't have those, I have a StepperOnline board that was designed to interface with Mach3. (I am not interested in spending another $200 to make Mach3 read more than 500 lines of g-code.)
What I am looking for is an M code that I can map to a pin number to turn it on and off.
My engraver has a motor to run the spindle and it's only on or off, no VFD in between.
So, if I could use, for example, the M03/M04 or M08/M09 to turn one of the relays on my board on and off I could start the program and let it run without having to check on it to manually turn on and off the spindle.
Thoughts?
Thanks
I did a search and really didn't find anything regarding commands to turn on specific pins of the DB25 connector.
I did find configuration files references for specific boards but I don't have those, I have a StepperOnline board that was designed to interface with Mach3. (I am not interested in spending another $200 to make Mach3 read more than 500 lines of g-code.)
What I am looking for is an M code that I can map to a pin number to turn it on and off.
My engraver has a motor to run the spindle and it's only on or off, no VFD in between.
So, if I could use, for example, the M03/M04 or M08/M09 to turn one of the relays on my board on and off I could start the program and let it run without having to check on it to manually turn on and off the spindle.
Thoughts?
Thanks
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10795
- Thank you received: 3556
23 Mar 2022 20:58 #238136
by rodw
Replied by rodw on topic Commands in LinuxCNC to control specific pins of the DB25 connector.....
No need to use a custom mcode. one of these will do the trick
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m62-m65
Pins are motion.digital-out-NN
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m62-m65
Pins are motion.digital-out-NN
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19479
- Thank you received: 6532
23 Mar 2022 21:52 #238145
by tommylight
Replied by tommylight on topic Commands in LinuxCNC to control specific pins of the DB25 connector.....
LinuxCNC has at least 3 pins for controlling the spindle, spindle-on, spindle-cv and spindle-ccv.
Spindle on should do exactly what you want and is activated by an M3 in gcode that is standard in all post processors. Turn off is with M5, again standard.
In the .hal file, it should be something like this for a parallel port:or in one line:
Spindle on should do exactly what you want and is activated by an M3 in gcode that is standard in all post processors. Turn off is with M5, again standard.
In the .hal file, it should be something like this for a parallel port:
net spindle-on <= motion.spindle-on
net spindle-on => parport.0.pin-09-out
net spindle-on <= motion.spindle-on => parport.0.pin-09-out
Please Log in or Create an account to join the conversation.
- sd3534
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
23 Mar 2022 22:05 #238150
by sd3534
Replied by sd3534 on topic Commands in LinuxCNC to control specific pins of the DB25 connector.....
Thanks very much for the information and the help that's exactly what I needed!
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- sd3534
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
24 Mar 2022 13:47 #238222
by sd3534
Replied by sd3534 on topic Commands in LinuxCNC to control specific pins of the DB25 connector.....
Thanks very much for the information, I will check to see if the pins that control the spindle are mapped to the pins that turn on the relays on my board.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
24 Mar 2022 22:15 #238285
by andypugh
Replied by andypugh on topic Commands in LinuxCNC to control specific pins of the DB25 connector.....
Just modify the pin number in Tommylight's example to use a different DB25 pin.Thanks very much for the information, I will check to see if the pins that control the spindle are mapped to the pins that turn on the relays on my board.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- Commands in LinuxCNC to control specific pins of the DB25 connector.....
Time to create page: 0.063 seconds