Using an existing language is the approach I used. I wrote a simple library for PHP, BASIC and JavaScript. Integrating any language into the EMC2 user interface is trivial. Generating useful G-Code is the real trick.
Here is a link to the basic version: http://www.unfocusedbrain.com/projects/2010/basictogcode/ It allows you to write code in BASIC and load it directly into EMC2. Example: import cnc cnc.SAFEZ=1.2 cnc.header(120) rem 120 ipm FOR Z = 0 TO -1 STEP -0.1 cnc.drawCircle(0,0,Z,1) NEXT Z cnc.footer() Link to the php version: http://www.unfocusedbrain.com/projects/2009/phpgcode/ All of this is very ALPHA. Unfocused Brain. Neil Baylis wrote: > This is a very powerful extension, but I'm wondering if it's the best > approach. Rather than coming up with a new meta-language for creating > G Codes, why not just add a statement that runs an external program > that outputs G Codes? That way, you can write the program in any > language you like, make use of IDEs, debuggers, or whatever, without > having to re-invent the wheel. It would work similarly to the way CGI > works for websites. The external program would simply output G Codes > to stdout. > > I understand there's already the ability to run an external program > triggered by an M Code, but I don't think you can get output from that > program back into your original G Code program. (Of course, I may be > wrong about this...) > > The problem with creating a new language is that you can't use any > existing tools for debugging it; you have to create everything from > scratch. > > Neil > ------------------------------------------------------------------------------ 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
