Commands in LinuxCNC to control specific pins of the DB25 connector.....

More
23 Mar 2022 19:02 #238127 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

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

More
23 Mar 2022 20:58 #238136 by rodw
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

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
23 Mar 2022 21:52 #238145 by tommylight
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:
net spindle-on <= motion.spindle-on
net spindle-on => parport.0.pin-09-out
or in one line:
net spindle-on <= motion.spindle-on => parport.0.pin-09-out

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

More
23 Mar 2022 22:05 #238150 by sd3534
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.

More
24 Mar 2022 13:47 #238222 by sd3534
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.

More
24 Mar 2022 22:15 #238285 by andypugh

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.

Just modify the pin number in Tommylight's example to use a different DB25 pin. 
The following user(s) said Thank You: tommylight

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

Time to create page: 0.063 seconds
Powered by Kunena Forum