Generating CNC code
from a domain specific language
|
|
|
|||||||
|
Computerized Numeric Control (CNC) is an industrial language for the
manufacturing of products. CNC programs are series of code that consist of
assembler-like instructions, consequently they are
low-level programs that require specialized developers in order to gain
productivity in programs writing. In this work we introduce a domain specific
language for the generation of CNC programs. The DSL itself has been developed
in Curry, a declarative multi-paradigm functional-logic language. Our DSL
includes a set of functions that encapsulate CNC instructions raising the
abstraction level, and therefore, improving productivity. It is designed in
such a way that non expert users can write CNC programs. We show how the use
of a DSL allows us to perform the requirements capture and to reduce the gap
between the requirements and the prototype. Finally, from our domain specific
language we generate real CNC code in order to produce real world
applications. |
|
|||||||
|
|
|
|||||||
|
We consider a simple CNC milling
machine which can move the turret chuck in the X, Y and Z axes. The machine
also handles absolute and incremental positioning of the turret chuck..
A CNC program for cutting a circular arc from
(1,1) to (3,3) with center in (2,2) is as follows: More information about
G-codes and the standard ISO6983 can be found in: |
|
|||||||
|
|
|
|||||||
|
We have
developed the following DSL function programmed in Curry:
An example
of a Circular canned:
|
|
|||||||
|
Implementation |
|
|||||||
|
Here you can download the
complete DSL Curry library: |
|