NC program management

INCT_ProgramManager - interface to manage the NC programs. The interface provides interaction with text of the NC programs, the order of transfer of the NC programs to the interpreter.

Description of interface methods:

Method

Method Description

Description of use

Get_Count

The function returns the number of NC (files*) generated by the postprocessor for the current operation.

No input parameters.

In case the postprocessor generates several texts with the NC (files*), it may be necessary to change the order of transfer of the texts for handling by the interpreter.

To determine the presence of several texts with the NC, you need to use the Get_Count function.

In some cases, the postprocessor can generate unique file* names with auxiliary data (without NC text) that do not need to be interpreted. Or, on the contrary, to form a header file from which the remaining texts of the NC are called. To identify such files by name, the Get_Name function is used.

If it is necessary to change the processing text order of the NC formed by the postprocessor for interpretation, then the function of adding the NC text to the interpretation list (AddToOrderList) is intended. NC will be transmitted to the interpreter in the order specified in the list, from the first one added to the list to the last one.

Get_Name

The function returns the name of the file* with the NC (string) by the index of the text from the NC (file*) transmitted in the input parameter.

Input parameters: Index (integer) – NC text number (file*) formed by a postprocessor for the current operation. Value from 0 to Get_Count -1

AddToOrderList

The method adds the NC (file*) with the specified index to the interpretation list. NC will be transmitted to the interpreter in the order specified in this list, from the first one to the last one. If the texts with NC are not added to the list, it will not be transferred to the interpreter. If no text with the NC is added to the NC list, all files will be transferred to the interpreter in the order generated by the postprocessor for the current operation.

Input parameters: Index (integer) – number of the NC (file *) generated by the postprocessor for the current operation. Value from 0 to Get_Count -1

GetPartByIndex

The function returns the text of the NC (INCT_Program interface) by the index of the text from the NC (file*) transmitted in the input parameter.

Input parameters: Index (integer) – number of the NC (file*) generated by the postprocessor for the current operation. Value from 0 to Get_Count -1.

To form the processing order of texts with the NC (files*) by the interpreter, it may be necessary to analyze the contents of one or several NC texts in the current operation. The execution of the function with the text number will return the INCT_Program interface, with the help of the functions of which you need to read the lines of the searched NC.

GetPartByLabels

The function returns the text of the G-code (interface INCT_Program) on the labels passed in the input parameters.

Input parameters: StartLabel (string), StopLabel (string) – marks the beginning and end of the text of the G-code.

If the formation of the path of movement of the tool turning cycle contour processing (analog CYCLE95 for the stand Sinumerik) is not built into the kernel of the former (Turning machining cycle), it is possible to obtain the text of the G-code with the cycle path for its subsequent independent analysis. The GetProgramByLabels function is intended for this purpose.

* – during postprocessing, files with text of the NC are not created on the disk for interpretation. NC texts exist only in memory. File names and numbering are stored in connection with the existing technology and for the formation of the order of processing texts with the NC.


INCT_Program – interface for NC text receiving. The interface implements the work with the NC, returned by some INCT_ProgramManager functions.

Interface methods description:

Method

Method description

Description of use

EndOfFile

The function returns the end of lines. True – the NC text end. False – the NC text is not fully read.

After receiving the interface, each subsequent call to GetNextLine returns the next line of the NC text, starting from the 1-st to the last line. After receiving the last line, the EndOfFile function will get a True value.

GetNextLine

The function returns the next NC string