Michael Haberler wrote:
> I'm now looking seriously into creating custom g/mcodes.
>
Excellent!
> Your proposal on the wiki assumes every parameter word is made accessible to
> the subroutine, and it's the sub's responsibility to figure what makes sense.
>
> My idea would rather be a check during conversion - before calling the sub -
> driven by a parameter spec as follows:
>
> # define custom G and M codes
> # syntax: GCODE=<number>,<argument spec>
> # argument spec:
> # an uppercase letter for each required parameter 'word'
> # a lowercase letter for each optional parameter 'word'
> #
> [CUSTOM]
> GCODE=88.1,XYZR # G88.1 requires all of X,Y,Z,R to be present
> GCODE=88.2,XYpq # G88.2 requires X,Y and takes optional P and Q
>
> MCODE=290,PQ # M290 requires P and Q
>
> Any required parameters would be available as '#<X>' or some variant thereof.
> Optional parameters could be tested for with the EXISTS(#<P>) function.
>
Something to consider: what about a routine that needs one or another
word from a group, but not necessarily all of them? For example, G0 or
G1 require at least one axis word to be present, but as long as there's
at least one, there may be up to 9 (XYZABCUVW).
The next complex case is one where you may need one or another set of
words, as used in circles. You can specify R or IJK, but not both.
This is even trickier because the active plane determines which of IJK
are valid.
It may be possible to specify all of these options with regex/glob-like
syntax:
[XYZABCUVW] means any or all axis words.
{R,IJK} would be either R or I and J and K
{R;[IJK]} would be R or at least one of IJK
I'm not sure how to specify a dependence on the active plane, or a
dependence on some other machine state I haven't thought of. I guess
another comma-separated field (or set of fields) could work:
GCODE=88.1,plane,[XYZ]{R;[IJK]}
There is actually a full set of preconditions and postconditions for
every G-code. To be able to fully re-define G-codes, it may be
necessary to figure out how to specify these in the ini (or other
config) file.
- Steve
------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers