Well, how's this work overall? A G-code called via MDI make take 10 sec to run. If the halui remains true for more than one user space cycle, I presume the rule is to just ignore all the calls if the machine is already running G-code?
It did occur to me that it would make perfect sense to only allow the X=0.5X to be executed once and that latch gets reset by zeroing the X work offset. Because I see no way you could ever need to press it again without zeroing. If you were in the wrong place when you hit X=0.5X (whoops, I'm at the right spot for Y=0.5Y but hit it for X??), you cannot fix it by hitting X=0.5X again. You need to find work X=0, zero again, move to X max on the stock, and press X=0.5X again. This sounds desirable, it is all too easy to get tired and press X=0.5X once, take a sip of coffee, look back, and press it again, screwing up the X zero point. There is no "back arrow" to fix that little typo. Only prob is, yes I can connect a latch-reset to the MPG's button for (current axis)=0, but I don't know any way to do that IF the user does (work axis)=0 from the keyboard instead of MPG. It could be done via the control panel or a manually entered MDI command. In that case the latch would not be reset and it would refuse to perform X=0.5X later. Danny ---- Todd Zuercher <zuerc...@embarqmail.com> wrote: > ----- Original Message ----- > From: "andy pugh" <bodge...@gmail.com> > To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net> > Sent: Wednesday, December 28, 2016 4:54:02 AM > Subject: Re: [Emc-users] Calling MDI from HAL > > >On 28 December 2016 at 07:33, Danny Miller <dan...@austin.rr.com> wrote: > >> Say I want to use a button to call a one-time G-code op via MDI. > >> Literally once. Repeat calls will break things. > > > >Is it possible to have the G-code subroutine refuse to run twice? > >Perhaps through use of a parameter that is not saved through restart? > > > >This is probably more reliable than single-shotting in HAL, as there > >is some chance that halui might miss a single-cycle pulse (it runs in > >user-space not realtime) > > This might be a little bit of a roundabout way to get there but it might work > for you. > > create a custom M1xx code to setp the hal pin to call your halui-mdi command > that you only want ever called once. Then setup another halui-mdi command to > call that M1xx code and connect that to your button. Pressing the button > multiple times should have no effect because the once the setp for the first > command is set true, it will stay that way and multiple presses should have > no effect. And if you should have a need to reset it, you could set up > another way to setp it back. > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Emc-users mailing list > Emc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-users ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users