On 23.03.12 08:53, Michael Haberler wrote:
> As for introspection on state at the gcode level, see
> http://www.linuxcnc.org/docs/devel/html/gcode/overview.html#_predefined_named_parameters_a_id_sec_predefined_named_parameters_a

Many thanks for that link, Michael. And I thought that:

http://www.linuxcnc.org/docview/html/gcode_overview.html#sub:Named-Parameters

was the definitive reference on the subject. There are more hidden gems
in the LinuxCNC documentation warren than any single human knows about,
I suspect. 

I'll update the code generation to exploit those predefined named
parameters which you've revealed. Although it'll only save a gcode
assignment at each G90/G91, it'll be more canonical in its machine state
testing.

> If that doesnt suffice, go to the embedded Python level which has
> practically all of the interpreter state exposed, and then some
> (task).
> 
> See tests/remap/introspect/oword.py for state access.

Seeing there, things like:

self.params["a_new_local"] = 321.0

I'm tempted to guess (based on zero prior exposure to python), that
that's probably a hash.¹ Having that available in bison would have made
the symbol table much easier to implement. ;-)

> Exporting state from Python is left as an exercise for the reader;)

Since the translator could be run as a filter or off-line, tests need to
be executed in gcode, so that they're real-time. I don't know of a
method to run in-line python in gcode, and have yet to see a need for
it, anyway. The predefined named parameters you've shared do it for me,
AFAICT.

My belief that LinuxCNC was limited was largely based on a post from:

Date: Mon, 6 Feb 2012 13:27:12 +0200
»
if (SpindleMode=CSS) uimessage "some relevant message"
That can't be converted to generic G-code because generic G-code is
bad at strings and has no mode introspection.
«

and the absence of any contrary thoughts on the list in the last several
years. But it turns out that even #<_spindle_css_mode> is available.

Thanks again for finding the treasure.

Erik

¹ Or "associative array" to awk fans.

-- 
We shall not cease from exploration, and the end of all our exploring
will be to arrive where we started and know the place for the first
time.                                                    - T.S. Elliot

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to