to complete the state save-restore work (saving and restoring modal codes) there's an open question how abort and program end should be handled.
What we currently have is (see examples below): M70 to store modal codes at the current call level (global, or a specific subroutine call instance). M72 to explcitly restore modal codes from saved state at the level. M70 to store modal codes at the current call level, and implicitly restore state on subroutine return or subroutine exit. This works fine so far. The question is: what should happen if state was saved by some combination of the above, potentially nested in active subroutine call frames, if an abort happens (eg user types 'Escape' in Axis), and when a program ends. Options I see: a) do nothing and look in the other direction. b) only restore the state saved at the global level if any c) simulate a sequence of returns through all levels, restoring in turn whatever valid state was preserved is found at that level The more I think about it, and heed the 'minimum surprise principle', I'd prefer (different from what I proposed below): on abort: use b) only. This means only if either a M70 or M72 was executed in the *main* program, that state is restored on abort. If no M70/72 was present, nothing is restored at all. on program end: a) - do nothing (although same as 'on abort' would be an option, higher suprise factor though). I'd appreciate 'guidance' ;-) -m see also: M70 and M72 in action: http://git.mah.priv.at/gitweb/emc2-dev.git/blob/state-save-restore-preview2:/nc_files/m70m72-demo.ngc M73 in action: http://git.mah.priv.at/gitweb/emc2-dev.git/blob/state-save-restore-preview2:/nc_files/m73-demo.ngc Am 08.03.2011 um 06:52 schrieb Michael Haberler: ... > > I see a few open questions: > > - assume you do an M71.1 at the global level. The gcode program ends. Should > state be restored in this case? > I'm unsure; maybe a warning about using M70.1 at the global level should be > issued; the other option is to restore state at M2. > > - assume you issued an M71.1 at the global level, and the program is aborted > for some reason, like an Escape key hit in Axis, or the halui.abort pin. It's > kind of like an exception which unwinds the call stack. > What should be done? options are: > a) do nothing > b) only restore the state saved at the global level if any > c) simulate a sequence of returns through all levels, restoring in turn > whatever valid state was preserved is found at that level > > My guess would be: use b) if there was a M70 at the global level, else c) > ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
