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.

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