On Wed, 2010-07-07 at 12:46 +0100, Andy Pugh wrote: > On 7 July 2010 08:08, yann jautard <brico...@free.fr> wrote: ... snip > Comp makes it really pretty easy. > http://linuxcnc.org/docs/html/hal_comp.html > Look at the examples at the bottom to see how easy it can be.
Yann: Just in case you consider using a comp, here is a link to my tool changer component: http://www.wallacecompany.com/cnc_lathe/HNC/emc2/turret-1f.comp The main idea here is that the component runs or loops at the rate of the thread that it is assigned to (usually the servo thread, and usually every 1 millisecond). Different machine "states" or "case" are assigned, then the loop checks the current state, invokes a solution, then updates the state for the next loop cycle. Writing a custom comp lets one assign input pins, such as Tank 1 Sensor, Tank 2 Sensor, and output pins such as Pause and Low Tank Level Warning Indicator. The inputs define a state. The outputs are set according to the case that matches the state. The comp pins are connected to EMC2, such as switch inputs and relay outputs on the parallel port, in your .hal file. Also, you may be able to use a Python, Bash, Basic or other script interfaced to EMC2 with M100: http://linuxcnc.org/docs/html/gcode_main.html#sec:M100-to-M199: I don't think your application needs real-time, so the above might be usable. Or, check out O codes: http://linuxcnc.org/docs/html/gcode_main.html#cha:O-Codes I seem to recall, there might be another "pause on pin state condition" built into another g-code. -- Kirk Wallace http://www.wallacecompany.com/machine_shop/ http://www.wallacecompany.com/E45/index.html California, USA ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users