On 15 March 2010 19:47, Dave <[email protected]> wrote: > As usual, there are a number of ways to do this within EMC2. If you just > want to use digital I/O, look at the custom Mcodes. Also look at the > Gcodes that allow you to wait for an input and set an output.
I have recently found another way, which might suit this application very well indeed. the [HALUI] section in the INI file lets you define commands to run when a pin goes true. You can add up to 64. The format is MDI_COMMAND <some G-code string> Each line creates a HAL pin of the form halui.mdi-command-XX In the more recent versions of EMC2[1] you are not limited to just normal G-codes, the format MDI_COMMAND O<subroutine-name> CALL also works. This means that the toolchanger robot could be set to run a specific set of G-code instructions for a number of different digital inputs. At the machine-tool end you could use a pair of digital I/O commands (M66: http://wiki.linuxcnc.org/emcinfo.pl?Mword ) to send the trigger and to wait for the "completed" signal. I think it ought to be possible for the subroutines to be external subroutine files, but at the moment I have only made it work for subroutines in the currently-loaded .ngc file. [1] It doesn't work in 2.3.0, it does work in 2.4-pre -- atp ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
