Interpreters development
  • Interpreters development
v3.0.4
Search Results for

    Show / Hide Table of Contents

    NC program management

    INCT_ProgramManager - an interface for working with the NC program text. The interface provides work with the NC program text and with the order in which the NC program texts are passed to the interpreter.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    Get_Count

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

    No input parameters.

    If the postprocessor generates several NC program texts (files*), it may be necessary to change the order in which the texts are passed to the interpreter.

    To find out whether there are several NC program texts, use the Get_Count function.

    In some cases the postprocessor can generate files* with unique names that contain auxiliary data (no NC program text) and must not be interpreted. Or, on the contrary, it can generate a header file from which the other NC program texts are called. The Get_Name function is intended for identifying such files by name.

    If the order of processing the NC program texts generated by the postprocessor must be changed for the interpretation, use the function of adding an NC program text to the interpretation list (AddToOrderList). The NC program texts are passed to the interpreter in the order set in the list, from the first added to the last.

    Get_Name

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

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

    AddToOrderList

    The method adds the NC program text (file*) with the specified index to the interpretation list. The NC program texts are passed to the interpreter in the order set in this list, from the first added to the last. NC program texts not added to the list are not passed to the interpreter. If no NC program text has been added to the list, all files are passed to the interpreter in the order generated by the postprocessor for the current operation.

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

    GetPartByIndex

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

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

    To set the order in which the interpreter processes the NC program texts (files*), it may be necessary to analyze the contents of one or several NC program texts of the current operation. Calling the function with the text number returns the INCT_Program interface; read the lines of the NC program text with its functions.
    GetPartByLabels

    The function returns the NC program text (INCT_Program interface) by the labels passed in the input parameters. The search is made from the beginning of the NC program text.

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

    If the generator built into the kernel (Turning stock removal cycle) is not enough to form the tool path of a turning contour cycle (like CYCLE95 for the Sinumerik controller), the NC program text with the cycle path can be obtained for its own analysis. The described function is intended for this.

    * - during postprocessing for interpretation, files with NC program texts are not created on disk. The NC program texts exist only in memory. File names and numbering are kept because of the existing technology and to set the order of processing the NC program texts.

    INCT_ProgramManager2 - an interface for working with the NC program text.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    GetPartByLabelsFromCurPos

    The function returns the NC program text (INCT_Program interface) by the labels passed in the input parameters. The search is made from the current position.

    Input parameters: StartLabel (string), StopLabel (string) - start and end labels of the NC program text; Direction (TNCGetPartDirection) - search direction: gpdForward - forward from the current position, gpdBackward - backward from the current position.

    See the use of GetPartByLabels.
    GetPartByRegisters

    The function returns the NC program text (INCT_Program interface) by the registers passed in the input parameters.

    Input parameters: StartReg (INCT_Register), StartValues (INCT_RegisterValues), StopReg (INCT_Register), StopValues (INCT_RegisterValues) - registers and values of the start and end of the NC program text; Origin (TNCGetPartOrigin) - search origin: gpoFromCurPos - from the current position of the NC program, gpoEntireScope - from the beginning of the NC program.

    INCT_GetPartByUser - an interface for working with the NC program text.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    GetPartByUser

    The function returns the INCT_Program interface for working with the NC program.
    Input parameter: Origin (TNCGetPartOrigin) - search origin:

    gpoFromCurPos - search from the current position of the NC program;

    gpoEntireScope - search from the beginning of the NC program.

    The function allows determining the start and end of a subprogram by any specified labels.
    1) Get the INCT_Program interface with GetPartByUser.

    2) For example, the values of the subprogram start and end labels can be passed in INCT_InterpreterState, or registers can be used for this.

    3) After the DoSubprogram procedure of the INCT_Kernel2 interface is started, the subprogram is searched. If INCT_InterpreterState has been used, the previously saved labels can be obtained, or the required subprogram start label can be found in the TransLine method and IsStart called. The IsEnd procedure is used in the same way.

    IsStartThe procedure marks the start of the subprogram.
    IsEndThe procedure marks the end of the subprogram.

    INCT_Program - an interface for getting the NC program text. The interface provides work with the NC program text returned by some INCT_ProgramManager functions.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    EndOfFileThe function returns the end-of-lines flag. True - the NC program text has ended. False - the NC program text has not been read completely.After the interface is obtained, each next call of GetNextLine returns the next line of the NC program text, from the first to the last line. After the last line is obtained, EndOfFile returns True.
    GetNextLineThe function returns the next line of the NC program.
    In this article