SMC_NCNavigator (FB)¶
FUNCTION_BLOCK SMC_NCNavigator
This function block selects one of a given number of G-sentence queues. The selection is done based on the called subprogram and controlled by SMC_NCInterpreter.
Additionally to subprogram calls and returns, this function block also handles jumps to sentence numbers, jumps to jump targets, and step suppression.
Note
This function block is included in SMC_ReadNCFile2 and is needed in CNC applications only in special cases.
- InOut:
Scope
Name
Type
Comment
Inout
sentencesThe output sentence queue that can be fed into SMC_NCInterpreter. Note: this queue must have capacity 1.
Input
bExecuteBOOLA rising edge starts the execution.
bStepSuppressBOOLWhen this input is
TRUE, lines of the CNC program starting with ‚/’ will be ignored. Otherwise they will be processed.pSentenceQueuesPOINTER TO SMC_GSentenceQueue
Pointer to the first element of an array of sentence queues, one for each subprogram call depth. The first is used for the main program. Note that the last queue is reserved for parsing subprogram declarations, so the effective maximum call depth is nNumSentenceQueues - 1. Read each cycle, not only at the rising edge of bExecute.
nNumSentenceQueuesUDINTThe number of sentence queues. Must be at least 1.
stSubprogramDeclRequestSTRINGIf this input is set to an non-empty string, the last sentence queue will be used to read the subprogram with the given name in order to store the declaration in the symbol table. Read each cycle, not only at the rising edge of bExecute.
Output
bBusyBOOLTRUEwhile execution of function block is not finishedbErrorBOOLTRUEsignals that an error has occurred within the function block.ErrorIDSMC_ERRORError identification
errorPosThe source-position where an error has been detected.
RequestedSentenceQueueIdxUDINTThe zero-based index of the active sentence queue.
RequestedProgramNameSTRINGThe program name of the requested sentence queue. Only relevant if RequestedSentenceQueueIdx is increased.