Personally, I think I'd lean more towards using the hal onshot components. http://linuxcnc.org/docs/html/man/man9/oneshot.9.html For your M3/M5 connection, you'd connect two oneshots to the normal spindle command, one set to rising edge would connect to your M3 relay, one falling edge to the M5.
----- Original Message ----- From: "Chris Radek" <ch...@timeguy.com> To: "Matthew Hubbard" <hubbard1...@ymail.com>, "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net> Sent: Friday, May 27, 2016 8:07:19 PM Subject: Re: [Emc-users] M codes On Fri, May 27, 2016 at 11:16:22PM +0000, Matthew Hubbard wrote: > ??Hi allI am in the process of doing a retrofit on an old yuasa > cnc mill. The machine has a relay board that i can interface with > that executes m codes. For example if i ground the coil of the > relay (momentarily) for the M3 relay, the spindle latches on, and > if i do that for the M5 relay, the spindle latches off. My current > understanding is that by default if I command an M3 it will hold > the M3 signal on until i command an M5, where it turns off again. > Can somebody point me in the right direction of how i can control > on/off with two signals? I would sure do this with ladder. You can use rising-edge (the ones that look like -|^|- ) to trigger timers that poke your relays for the appropriate amount of time. I bet you will end up with interlocks, etc, that are really easy to do in ladder, and totally possible but really tedious to do in bare hal. Ladder has a learning curve but for any nontrivial machine (does it have a tool changer?) it's worth your time to learn it anyway. The other answer is probably to use a bunch of oneshot components, but consider what happens if you turn the spindle on and then immediately off - if they're not carefully interlocked you'll end up poking your M3 and M5 signals at the same time (which may or may not be ok...?) Chris ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users