SMC_NCTokenizer.SetDelimiters (METH) ¶ METHOD FINAL SetDelimiters : BOOL Reconfigures delimiters for comment, string and variable tokens. Returns TRUE if configuration was accepted and the FB isn’t busy, FALSE otherwise. This method typically is called before SMC_NCTokenizer is called in the first place. Delimiter tokens may start with every character in aby*StartDelim , but must end with the character in aby*EndDelim with the same array index as the starting character. Only the following values/characters are allowed as delimiters: 33 ! , 34 " , 35 # , 36 $ , 37 % , 38 & , 39 ' , 40 ( , 41 ) , 42 * , 43 + , 44 , , 45 - , 47 / , 58 : , 59 ; , 60 < , 61 = , 62 > , 63 ? , 64 @ , 91 [ , 92 \ , 93 ] , 94 ^ , 96 ´ , 123 { , 124 | , 125 } , 126 ~ A maximum of 3 different pairs of delimiters can be configured for each token type. Delimiters will be checked for ambiguitiy against each other. Only operator characters not used as delimiter will be recognized as operators. InOut: Scope Name Type Comment Return SetDelimiters BOOL Inout Const delimCfg SMC_NCScanner_DelimConfig Output aValOps ARRAY [0..(SoftMotion_Token_Constants.c_numVarNameChars - 1)] OF BYTE List of characters effectively handled as operators after substracting all configured delimiters; 0 value must be ignored.
SMC_ReadNCTokens (FB) ¶ FUNCTION_BLOCK SMC_ReadNCTokens SMC_ReadNCTokens reads from a SMC_TokenQueue of SMC_Token and transforms it into a SMC_CNC_REF . InOut: Scope Name Type Comment Inout ncprog SMC_CNC_REF Output CNC program tokens SMC_TokenQueue Input token queue Input bExecute BOOL While TRUE , the function block is active. pBuffer POINTER TO BYTE Pointer on a sufficiently large, free data area (buffer) that is allocated in the IEC application. It is strongly recommended to allocate the buffer as ARRAY[0..x] OF |ioSMC_GCODE_WORD| in order to make sure to have a correct data alignment. A definition of ARRAY[0..x] OF BYTE may lead to a misaligned data access on some platforms. dwBufferSize DWORD Size of the buffer in byte pStringBuffer POINTER TO SMC_StringBuffer Pointer to an object of type SMC_StringBuffer This object is used to store strings that are defined in the G-code program in order to write them to variables using G36&37. If the pointer is not set (0) and string constants are used in the G-code program, an error will be generated.(´´SMC_RNCF_NO_STRINGBUFFER´´). pvl POINTER TO SMC_VARLIST If there aren’t variables in the CNC programm, this input isn’t set. SMC_VARLIST fDefaultVel LREAL fDefaultAccel LREAL fDefaultDecel LREAL fDefaultVelFF LREAL Default velocity for fast forward (G0), FF word fDefaultAccelFF LREAL Default acceleration for fast forward (G0), EF+ word fDefaultDecelFF LREAL Default deceleration for fast forward (G0), EF- word. A non- negative value is expected. b3DMode BOOL If TRUE, an implicit G17 is prepended to the G-code. bEnableSyntaxChecks BOOL Turns on syntax checks that will detect invalid g-code and stop with an error in this case Output bDone BOOL TRUE if parameter is available bBusy BOOL TRUE while execution of function block is not finished. bError BOOL TRUE signals that an error has occurred within the function block. ErrorID SMC_ERROR Error identification, SMC_ERROR Structure: Append3dMode (Action) AppendDynamics (Action) DoBeforeLeave (Action) IncreaseNumElems (Action) StepSuppress (Action)
SMC_ReadNCTokens.Append3dMode (ACT) ¶
SMC_ReadNCTokens.AppendDynamics (ACT) ¶ Append special source line word
SMC_ReadNCTokens.DoBeforeLeave (ACT) ¶
SMC_StringStream2.SetEndOfData (METH) ¶ METHOD SetEndOfData
SMC_NCTokenizer (FB) ¶ FUNCTION_BLOCK FINAL SMC_NCTokenizer Reads a CNC program from an SMC_ITextStream and converts it into a SMC_TokenQueue of SMC_Token , which ultimately will be processed by SMC_NCTokenParser (which repleaces SMC_ReadNCTokens ). Delimiters for tokens of type string , comment and variable can be reconfigured using the method SMC_NCTokenizer.SetDelimiters . InOut: Scope Name Type Initial Comment Input bExecute BOOL Rising edge: Starts operation. bAbort BOOL If TRUE , the current processing of this function block is aborted stream SMC_ITextStream Stream to read the CNC program from; e.g. might be a file stream paTokensBuffer POINTER TO ARRAY [0..0] OF SMC_Token Buffer for SMC_TokenQueue udiTokensBufferSize UDINT Length of buffer for SMC_TokenQueue bEnableSyntaxChecks BOOL TRUE Report an error in case of syntax error, if TRUE Skips the erroneous token, if FALSE Output bDone BOOL TRUE : The input stream has been processed completely. bBusy BOOL FALSE : The FB hasn’t finished processing the input stream yet. bError BOOL TRUE : An error occured. ErrorID provides additional information. ErrorID SMC_ERROR In case of normal operation SMC_Error.SMC_NO_ERROR , otherwise the ID of the occured error. tokens SMC_TokenQueue Token queue generated from the input stream diSourceLineNo DINT Zero-based current source line number diColumnNo DINT Zero-based current column number Methods: SetDelimiters Structure: DoBeforeLeave (Action) ProceedToNextToken (Action) ResetOutputs (Action) SetDelimiters (Method)
SMC_NCTokenizer.DoBeforeLeave (ACT) ¶
SMC_NCTokenizer.ProceedToNextToken (ACT) ¶ Remember begin of the next token
SMC_NCTokenizer.ResetOutputs (ACT) ¶