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_ProgramManager2 - interface to manage the NC programs.

Description of interface methods:

Method

Method Description

Description of use

GetPartByLabelsFromCurPos

The function returns the program text (INCT_Program interface) based on the labels passed in the input parameters. The search is performed from the current position.

Input parameters: StartLabel (string), StopLabel (string) - start and stop labels of the program text.

See the application of GetPartByLabels.


GetPartByRegisters

The function returns the program text INCT_Program interface) based on the registers passed in the input parameters.

Input parameters: StartReg (INCT_Register), StartValues (INCT_RegisterValues), StopReg (INCT_Register), StopValues (INCT_RegisterValues) - registers and values for the start and end of the program text.


INCT_GetPartByUser - interface to manage the NC programs.

Description of interface methods:

Method

Method Description

Description of use

GetPartByUser

The function returns the INCT_Program interface, which allows working with the program text.

Input parameters:

Type TNCGetPartOrigin:

gpoFromCurPos - perform the search from the current position in the program text

gpoEntireScope - perform the search from the beginning of the program text

The function allows determining the start/end of a subprogram based on any given labels.

1) Using GetPartByUser, we obtain the INCT_Program interface.

2) For example, in INCT_InterpreterState, values for the start/end labels of subprograms can be passed. Alternatively, registers can be used for this purpose.

3) After starting the DoSubprogram procedure of the INCT_Kernel2 interface, the subprogram search takes place. If INCT_InterpreterState was used, previously saved labels can be retrieved, or the required start label of the subprogram can be found in the TransLine method and IsStart can be called. Similarly, the IsEnd procedure is used.

IsStart

The procedure determines the start of the subprogram.

IsEnd

The procedure determines the end of the subprogram.


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