Hi Michael, On 16/03/14 09:19, Michael Haberler wrote: > Ed, > > Am 16.03.2014 um 09:24 schrieb Ed Simmons <[email protected]>: > >> Hi Linuxcnc list, >> >> I've just made a start with Gladevcp for a custom control panel for our >> engraving machine. >> >> We frequently cut and engrave bendy plastic panels that need to be set >> in the machine very level... we have a simple probe routine as a gcode >> file at the moment that probes the height of each corner and prints the >> heights in a debug message. >> >> 6 panels are fitted on 6 work offsets, G55 thru G59.1, whose X and Y >> coordinates don't need to change, only the Z needs checking, then when >> the panel is confirmed to be set flat enough, touched off to the correct >> height. >> >> What I'm aiming to achieve is a simple display for panel setting, for >> example a box with the height of each corner displayed after the probe >> routine has been run. >> >> I've created all the GUI bits I think I need, but I'm totally in the >> dark about how to obtain the heights from linuxcnc that I wish to >> display. I think I need to create some HAL signals for the heights that >> are measured and somehow set these signals at the right times. >> >> The Gcode probe routine uses a few numbered variables to store the >> heights of the corners of the work, here is how one corner is probed: >> >> G0 X12Y12Z5 >> G21 >> G91 G38.2 F100 Z-10 >> G90 G0 Z[#5063+0.10] >> G91 G38.2 F10 Z-0.20 >> #100=#5063 >> G90 G0 Z[#5063+5] >> >> So the height of this corner is stored in #100. Please could someone >> help me display the number stored in#100 in a label in a gladevcp panel? > unfortunately, there is no elegant solution to this problem - having > interpreter running and interact well with a UI - right now; it is an obvious > and glaring deficiency > > your best bet right now is to use HAL pins as communications vehicle - M6x > and friends: > http://www.linuxcnc.org/docs/devel/html/gcode/m-code.html#sec:M68-Analog-Output > > - Michael > > > ps: I'm working on this, but it will require a substantial sanitizing of > control flow between task and interpreter; I have a demo which shows how > things will progress here: > http://git.mah.priv.at/gitweb?p=emc2-dev.git;a=shortlog;h=refs/heads/interp-wait-poll > (not for the faint, and this will not be merged - it is exploratory in > nature) > > Using HAL pins is a great solution, I've got this working after now, like so:
G0 X12Y12Z5 G21 G91 G38.2 F100 Z-10 G90 G0 Z[#5063+0.10] G91 G38.2 F10 Z-0.20 #100=#5063 G90 G0 Z[#5063+5] M68 E0 Q[#100] Setting the appropriate signal in the postgui hal file makes the GUI update when the signal changes. Thanks very much! Ed ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
