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
bExecuteBOOLRising edge: Starts operation.
streamStream to read the CNC program from; e.g. might be a file stream
paTokensBufferPOINTER TO ARRAY [0..0] OF SMC_Token
Buffer for SMC_TokenQueue
udiTokensBufferSizeUDINTLength of buffer for SMC_TokenQueue
bEnableSyntaxChecksBOOLTRUE
Report an error in case of syntax error, if
TRUESkips the erroneous token, ifFALSEOutput
bDoneBOOLTRUE: The input stream has been processed completely.bBusyBOOLFALSE: The FB hasn’t finished processing the input stream yet.bErrorBOOLTRUE: An error occured.ErrorIDprovides additional information.ErrorIDSMC_ERRORIn case of normal operation
SMC_Error.SMC_NO_ERROR, otherwise the ID of the occured error.tokensToken queue generated from the input
streamdiSourceLineNoDINTZero-based current source line number
diColumnNoDINTZero-based current column number
Methods:
Structure: