Interpreter library

The interpreter program library is a dynamic link library (DLL). Regardless of the platform for which the library is implemented (.NET / native), the library must export two functions:

NCT_GetInterface — returns an object to SprutCAM X that implements the interface for the interaction of the SprutCAM X core with the program library (INCT_Interpreter);

NCT_FreeMemory — frees the memory of all the objects created independently or received from SprutCAM X during operation.

An example of a class describing the functions of the interpreter library in C# (assembly for the .NET platform):
namespace sample
{
public class Interpreter : MarshalByRefObject
{
public static INCT_Interpreter NCT_GetInterface()
{
/* implementation */
}
public static void NCT_FreeMemory()
{
/* implementation */
}
}
}
Description of functions of the native interpreter library in Delphi:
function NCT_GetInterface: INCT_Interpreter; stdcall;
procedure NCT_FreeMemory; stdcall;
Description of functions of the native interpreter library in С++:
INCT_Interpreter __stdcall NCT_GetInterface();
void __stdcall NCT_FreeMemory();

All types required for SprutCAM X interaction with the interpreter program library are listed in the type library that is included in the SprutCAM X distribution (TypeLibraries\*.tlb catalog).

The following TLB files contain the description of the types that are used in conjunction with the interpreter library:

  • STNCInterpreter.tlb — basic list of types;

  • STNCAnalyzer.tlb — types used for control analysis of the text of the NC;

  • STNCFormers.tlb — types used to simplify the construction of tool paths (linear/circular movements, cycles).

To connect the type library to your development environment, refer to the appropriate documentation section of the development environment.

Register type library

To register a type library in Microsoft Visual Studio, try the following:

Locate the file on your computer tlbImp.exe. Execute the command “tlbimp.exe tlb-filename”. As a result, the command file “tlb-filename.dll” will be created (e.g., “STNCAnalyzer.dll”). Add the dll file in your project via the menu item “Add Reference”.

The page Examples of interpreters with source codes will give an example of the source codes of the interpreter library, the 'dll' compiled from them, and an example of the settings file.