NCCL is a programming language that can be used to write programs that create Gcode files. Such files can be sent to a 3X milling machine or to a simulator. NCCL is based on LUA  and this means that every syntactical construct that one can use in LUA can be used in NCCL as well. In order to be effective in CNC environments, some subsystem has been implemented inside the program executable and many variables are defined and maintained by the system to keep track of parameters that can act on the motions NCCL  can produce.

Motions subsystem
The motion subsystem is the data structure that keeps track and manage all the motions that the various commands create.  It's like an internal database and it's completely trransparento to the user. Each time a call to a command that create motion is issued, all the motions are generated and stored in this structure.
Example :

pocket(100, 100, 2)

A call to this command in a user program, will generate motions depending on other technological values like tool diameter, stepover and zstep. All these motion are immediately stored in the motion subsystem database. Further calls to the same or other commands will append motions to the one already stored in the subsystem.

Posprocessing subsystem
This subsystem is very important because it's the one that will actuallt create the final GCODE. It simply scan all the motions stored in the motion database in the order they were created and call the post porcessing routines. This subsystem is activated by the command post(). This is usually the last command in a user program. When it create the final output according to the syntax define in the postprocessor, it empty the motion database.
Inside the postprocessor every geometric information of the toolpath is accessible and the same is true for technoligical information like tool number, coolant spindle start and stop and so on. This means that it's possibile to write a postprocessor not only for a specific cnc controller, but event to write the toolpath in format like DXF ir IGES. Currently only a standard ISO postprocessor is available but  other will be available.

Theory of Operations
Writing NCCL programs is not different from writing scripts in other languages like perl or python.
Use an editor of choice and write your scritps. Then, run the script with nccl.exe. That's all. The output wil lbe created. Remember to always use a CNC simulator to check the correctness of the final code. For my test I use CncSimulator a very good simulator which is available free.
NCCL can be used interactively as well and this could be a good choice in the beginning phase to learn how it works. Experienced users could use text editors to write scripts launching nccl.exe from a custom button. Many editors allow this.

NCCL commands has been designed to keep the number of parameters as low as possible. It's cumbersome to write a lot of data that not always necessary. In the same time, to modify the behaviour of the commands, some way is needed. The program would not be flexible otherwise.
The solution is : system variables. NCCL has a lot of internal variables that the user can obviously change. Most of them are read/write and they retain its value until changed. Almost all of the commands read the content of some system variables before calculating motions. This is how the use can change the behavoiour of the commands.

For example, consider this two instructions :

ZSTEP = 0.5

pocket(100,100, 5)

ZSTEP is a system variable. It holds the value of the Z increment that some commands will use to reach the required working depth. In the previous case, the pocket command will create a pocket of 100 x 100 millimeters with a depth of 5 millimeters. Since the last value of ZSTEP is 0.5, the command will create 10 layers each one being at 0.5 mm distance in Z axis. ZSTEP will maintain its value until it will be changed so there no need to set it every time (if you want that the Z increment will always be 0.5).
Other system variable just to name a few are :
What is NCCL ?
Home

Copyright © 2010 by Exgenia"   E-Mail: info@exgenia.com
FEEDRATE Set the feed off all next motions
WORKING_MODE Can be CLIMB or CONVENTIONAL to decide the machining strategy
STEPOVER Tool stepover
ANGLE To rotate motions
TOOL Set the Tool number
many others... To modify a lot of parameters