Interpreters development
  • Interpreters development
v3.0.4
Search Results for

    Show / Hide Table of Contents

    Managing NC program text analysis

    INCT_Analyzer - a CAM system interface that provides access to the settings of the NC program text analysis. The analyzer settings affect the algorithm of determining registers and values in the NC program text.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    BeginUpdate

    Signals the start of an INCT_Analyzer update.

    No input or output parameters.

    Call BeginUpdate to start changing the INCT_Analyzer settings. When the changes are finished, call EndUpdate to apply all of them.

    Each BeginUpdate call must be followed by a corresponding EndUpdate call.

    If only one INCT_Analyzer setting is changed at a time, BeginUpdate and EndUpdate are optional.

    EndUpdate

    Signals the end of the update. All changes made between the start and the end of the INCT_Analyzer update are applied.

    No input or output parameters.

    Get_CanUseEqualToAssignRegister

    The function returns the value of the setting 'The = character can be used to set a register value' (boolean). True: the NC program text analyzer uses the '=' character to set a register value. False: when a register value is determined, the '=' character is considered an invalid token.

    No input parameters.

    If the setting is on (True), the following combination of registers and values in the NC program text is considered correct:

    X=10.0 Y10.0 Z-1 A=-1 B+3.5 C=-3.5

    If the setting is off (False), the following way of setting register values is considered correct:

    Y10.0 Z-1 B+3.5

    Set_CanUseEqualToAssignRegister

    The method sets the value of the setting 'The = character can be used to set a register value'.

    Input parameter: Value (boolean), see the parameter description in Get_CanUseEqualToAssignRegister.

    No output parameters.

    Get_RegistersContainSpaces

    Deprecated

    The function returns the value of the setting 'A register can contain spaces' (boolean). True: when a register is determined, the NC program text analyzer takes into account that a register address can contain spaces. False: when a register is determined, a space is considered only a token separator.

    No input parameters.

    Deprecated

    If the setting is on (True), the following combination of registers and values in the NC program text is considered correct:

    TOOL CALL 1

    CYCL CALL

    provided that the registers with the addresses 'TOOL CALL' and 'CYCL CALL' are defined in the list. The register with the address 'TOOL CALL' gets the value 1. The register with the address 'CYCL CALL' must be defined as a register without a value (vatOnlyAddr).

    If the setting is off, the analyzer considers 'TOOL', 'CALL', 'CYCL', 'CALL' separate tokens.

    Set_RegistersContainSpaces

    Deprecated

    The method sets the value of the setting 'A register can contain spaces'.

    Input parameter: Value (boolean), see the parameter description in Get_RegistersContainSpaces.

    No output parameters.

    Get_RegistersCanEndWithPlusOrMinus

    Deprecated

    The function returns the value of the setting 'A register can end with a plus or minus' (boolean). True: when a register is determined, the NC program text analyzer takes into account that a register address can end with a plus or minus character. False: when a register is determined, the plus and minus characters are considered separate tokens that are not part of the register address.

    No input parameters.

    Deprecated

    If the setting is on (True), the following combination of registers and values in the NC program text:

    DL+0 DR+0

    is recognized as the register 'DL+' with the value 0 and the register 'DR+' with the value 0, provided that the registers with the addresses 'DL+', 'DR+' are defined in the list of addresses.

    If the setting is off, the analyzer considers 'DL', '+0', 'DR', '+0' separate tokens.

    Set_RegistersCanEndWithPlusOrMinus

    Deprecated

    The method sets the value of the setting 'A register can end with a plus or minus'.

    Input parameter: Value (boolean), see the parameter description in Get_RegistersCanEndWithPlusOrMinus.

    No output parameters.

    Get_RegistersCanEndWithNumber

    Deprecated

    The function returns the value of the setting 'A register can end with a number' (boolean). True: when a register is determined, the NC program text analyzer takes into account that a register address can end with an integer. False: when a register is determined, the number characters are considered separate tokens that are not part of the register address.

    No input parameters.

    Deprecated

    If the setting is on (True), the following combination of registers and values in the NC program text:

    DR2+0 R0

    is recognized as the register 'DR2' with the value 0 and the register 'R0' without a value, provided that the registers with the addresses 'DR2', 'R0' are defined in the list of addresses. The register with the address 'R0' must be defined as a register without a value (vatOnlyAddr).

    If the setting is off, the analyzer considers 'DR', '2', '+0', 'R', '0' separate tokens.

    Set_RegistersCanEndWithNumber

    Deprecated

    The method sets the value of the setting 'A register can end with a number'.

    Input parameter: Value (boolean), see the parameter description in Get_RegistersCanEndWithNumber.

    No output parameters.

    Get_LineBeginWithNumber

    The function returns the value of the setting 'An NC program line can begin with a number' (boolean). True: when an NC program text line is analyzed, the first token, if it is a number, is ignored. False: when an NC program text line is analyzed, the first number is considered a token.

    No input parameters.

    If the setting is on (True), the first token of an NC program line, if it is a number, is skipped.
    Set_LineBeginWithNumber

    The method sets the value of the setting 'An NC program line can begin with a number'.

    Input parameter: Value (boolean), see the parameter description in Get_LineBeginWithNumber.

    No output parameters.

    Get_Comments

    The function returns the interface for managing the settings of determining comments in the NC program text (INCT_Comments interface).

    No input parameters.

    If the following combinations of opening and closing characters are added to the comment settings:

    '!', ''

    '(*', '*)'

    then the NC program text lines

    ! X10 Y20 Z30.5 skip A+1

    (* test G01 X100 F100 *)

    are considered comments (skipped).

    Get_Brackets

    The function returns the interface for managing the settings of determining brackets in the NC program text (INCT_Brackets interface).

    No input parameters.

    Added for determining brackets in expressions. Brackets are recognized as separate tokens when the CanUseEqualToAssignRegister setting is on, but they are not used when determining the register value.
    Get_Quotes

    The function returns the interface for managing the settings of determining strings in the NC program text (INCT_Quotes interface).

    No input parameters.

    If the character '"' is added to the string settings and the setting 'The = character can be used to set a register value' is on, then the NC program text line

    T="1"

    is recognized by the analyzer as the register T with the value 1. The string value "1" is converted to the number 1.

    Get_UnionLineChars

    The function returns the interface for managing the settings of joining the NC program text lines (INCT_UnionLineChars interface).

    No input parameters.

    If the character "~" is added to the line joining settings, then the lines

    1 CYCL DEF 200 ~
    Q200=+1~
    Q201=-30.645~
    Q206=+200~

    are translated and interpreted as one line:

    1 CYCL DEF 200 Q200=+1 Q201=-30.645 Q206=+200

    Get_EndOfLineChars

    The function returns the interface for managing the settings of splitting the NC program text into lines (INCT_EndOfLineChars interface).

    No input parameters.

    If the character ";" is added to the line splitting settings, then the NC program lines

    MoveL [10,10,10,10];MoveL [20,20,20,20];

    MoveC [10,10,10,10],

    [10,10,10,10];

    are passed to the interpreter for translation according to the specified separator:

    MoveL [10,10,10,10];

    MoveL [20,20,20,20];

    MoveC [10,10,10,10], [10,10,10,10];

    Get_ExcludeEOLChars

    The function returns the value of the setting 'Exclude end-of-line characters from the NC program text' (boolean). True: when lines are split according to the settings set in INCT_EndOfLineChars, the end-of-line character is excluded from the text and is not passed to the interpreter. False: the end-of-line character is left in the text and passed to the interpreter.

    No input parameters.

    If the setting is on (True) and the specified separator is ';' (INCT_EndOfLineChars), then the following NC program text:

    MoveL [10,10,10,10];MoveL [20,20,20,20];

    MoveC [10,10,10,10],

    [10,10,10,10];

    is passed to the interpreter as follows:

    MoveL [10,10,10,10]

    MoveL [20,20,20,20]

    MoveC [10,10,10,10], [10,10,10,10]

    that is, the line separator character is excluded. If the setting is off, the text is passed as follows:

    MoveL [10,10,10,10];

    MoveL [20,20,20,20];

    MoveC [10,10,10,10], [10,10,10,10];

    Set_ExcludeEOLChars

    The method sets the value of the setting 'Exclude end-of-line characters from the NC program text'.

    Input parameter: Value (boolean), see the parameter description in Get_ExcludeEOLChars.

    No output parameters.

    INCT_Analyzer2 - a CAM system interface that provides access to the settings of the NC program text analysis.

    Description of the interface methods:

    MethodMethod descriptionDescription of use
    Get_RegistersCaseSensitivity

    The function returns the value of the setting "Case sensitivity".

    True: when the NC program text is analyzed, the register addresses are determined case-sensitively (registers with the addresses "A" and "a" are different).

    False: when the NC program text is analyzed, the register addresses are determined case-insensitively (registers with the addresses "A" and "a" are the same).

    No input parameters.

    If the "Case sensitivity" setting is on (True) and all registers of the interpreter are set in capital letters, the registers written in lowercase letters are skipped. For the following NC program text:

    G0 X0 Y0 Z0
    x10 y10 z10

    all registers of the first line are recognized and added to the list of objects for interpretation INCT_BlockExecArray. All registers of the second line are skipped (not recognized).

    Set_RegistersCaseSensitivity

    The method sets the value of the setting "Case sensitivity".

    Input parameter: Value (boolean), see the parameter description in Get_RegistersCaseSensitivity.

    No output parameters.

    INCT_Comments - a CAM system interface that implements the list of settings for managing comments. The settings consist of pairs of strings: an opening character set and a closing character set. When an NC program block is analyzed, the characters between any pair of opening and closing character sets are considered a comment and skipped. The closing character set can be an empty string; in this case, the rest of the line after the opening character set is considered a comment.

    Description of the interface methods:

    Method Method description Description of use
    Add The function adds a pair of settings to the list and returns the index of the added pair in the list (integer).
    Input parameters: Open (string) - opening comment character set; Close (string) - closing comment character set.
    To add comment settings when setting up the analyzer.
    Get The method returns the comment settings by index.
    Input parameter: Idx (integer) - index of the pair of settings.
    Output parameters: Open (string) - opening comment character set; Close (string) - closing comment character set.
    To get the settings.
    Delete The method deletes a pair of settings by the specified parameter.
    Input parameter: Idx (integer) - index of the pair of settings.
    To remove comment settings when reconfiguring the analyzer.
    Get_Count The function returns the number of pairs of settings (integer). To get the number of settings.

    INCT_Brackets - a CAM system interface that implements the list of settings for determining brackets in the NC program text. The settings consist of pairs of characters: opening and closing. Brackets are recognized as separate tokens when the CanUseEqualToAssignRegister setting is on, but they are not used when determining the register value; the settings are added for future use.

    Description of the interface methods:

    Method Method description Description of use
    Add The function adds a pair of settings to the list and returns the index of the added pair in the list (integer).
    Input parameters: Open (character) - opening bracket character; Close (character) - closing bracket character.
    To add bracket settings when setting up the analyzer.
    Get The method returns the bracket settings by index.
    Input parameter: Idx (integer) - index of the pair of settings.
    Output parameters: Open (character) - opening bracket character; Close (character) - closing bracket character.
    To get the settings.
    Delete The method deletes a pair of settings by the specified parameter.
    Input parameter: Idx (integer) - index of the pair of settings.
    To remove bracket settings when reconfiguring the analyzer.
    Get_Count The function returns the number of pairs of settings (integer). To get the number of settings.

    INCT_Quotes - a CAM system interface that implements the list of settings for determining strings. Each setting consists of the character with which a string value begins and ends. When an NC program block is analyzed, the characters between any pair of string characters are considered a string value.

    Description of the interface methods:

    Method Method description Description of use
    Add The function adds a setting to the list and returns the index of the added setting in the list (integer).
    Input parameter: Sym (character) - character with which a string value begins and ends.
    To add string value settings when setting up the analyzer.
    Get The method returns a setting by index.
    Input parameter: Idx (integer) - setting index.
    Output parameters: Sym (character) - character with which a string value begins and ends.
    To get the settings.
    Delete The method deletes a setting by the specified parameter.
    Input parameter: Idx (integer) - setting index.
    To remove string value settings when reconfiguring the analyzer.
    Get_Count The function returns the number of settings (integer). To get the number of settings.

    INCT_UnionLineChars - a CAM system interface that implements the list of settings for joining the NC program text lines. Each setting consists of a line joining character. If an NC program block ends with any character from the list, the line is joined with the next one without the joining character.

    Description of the interface methods:

    Method Method description Description of use
    Add The function adds a setting to the list and returns the index of the added setting in the list (integer).
    Input parameter: Sym (character) - line joining character.
    To add line joining character settings when setting up the analyzer.
    Get The method returns a setting by index.
    Input parameter: Idx (integer) - setting index.
    Output parameters: Sym (character) - line joining character.
    To get the settings.
    Delete The method deletes a setting by the specified parameter.
    Input parameter: Idx (integer) - setting index.
    To remove line joining character settings when reconfiguring the analyzer.
    Get_Count The function returns the number of settings (integer). To get the number of settings.

    INCT_EndOfLineChars - a CAM system interface that implements the list of settings for splitting the NC program text into lines. Each setting consists of a separator string. The NC program text is passed to the interpreter line by line, where each line is the content between separators.

    Description of the interface methods:

    Method Method description Description of use
    Add The function adds a setting to the list and returns the index of the added setting in the list (integer).
    Input parameter: Str (string) - separator.
    To add line separator settings when setting up the analyzer.
    Get The method returns a setting by index.
    Input parameter: Idx (integer) - setting index.
    Output parameters: Str (string) - separator.
    To get the settings.
    Delete The method deletes a setting by the specified parameter.
    Input parameter: Idx (integer) - setting index.
    To remove line separator settings when reconfiguring the analyzer.
    Get_Count The function returns the number of settings (integer). To get the number of settings.
    In this article