SMC_ReadNCFile2 (FB)¶
FUNCTION_BLOCK SMC_ReadNCFile2
SMC_ReadNCFile2 can read an NC-ASCII-file from the file system
of the controller in order to make it available for the SMC_NCInterpreter.
Thus, an NC program can be read in and interpreted at runtime.
- InOut:
- Scope - Name - Type - Initial - Comment - Input - bExecute- BOOL- Rising edge: starts execution. - bAbort- BOOL- If - TRUE, the current processing of this function block is aborted- sFileName- STRING(255)- File path of the file containing the g-code. - pvl- POINTER TO SMC_VARLIST - A variable list defining the type and address for each variable that can be used from the g-code. If there are no variables in the g-code, this input is not used. - fDefaultVel- LREAL- Default velocity; used if the velocity (F-word) is not specified inside the CNC file. Note: only applies to the main program, not to subprograms. - fDefaultAccel- LREAL- Default acceleration; used if acceleration (E+ word) is not specified inside the CNC file. A non-negative value is expected. Note: only applies to the main program, not to subprograms. - fDefaultDecel- LREAL- Default deceleration (E- word); used if deceleration is not specified inside the CNC file Note: only applies to the main program, not to subprograms. - fDefaultVelFF- LREAL- Default velocity for fast forward (G0), FF word. It is used if no velocity is specified inside the CNC file. Note: only applies to the main program, not to subprograms. - fDefaultAccelFF- LREAL- Default acceleration for fast forward (G0), EF+ word. It is used if no acceleration is specified inside the CNC file. Note: only applies to the main program, not to subprograms. - fDefaultDecelFF- LREAL- Default deceleration for fast forward (G0), EF- word. A non-negative value is expected. It is used if no deceleration is specified inside the CNC file. Note: only applies to the main program, not to subprograms. - b3DMode- BOOL- TRUE - If - TRUE, a G17 command (activation of 3D-mode) is executed implicitly. Note: only applies to the main program, not to subprograms.- bStepSuppress- BOOL- When this input is - TRUE, lines of the CNC program starting with ‚/’ will be ignored. Otherwise they will be processed.- aSubProgramDirs- ARRAY [0..4] OF STRING(174) - An array of up to 5 directories where subprograms are searched. For a subprogram with name “SUB”, the file “sub.cnc” (lower-case) is searched in each of the given directories, starting with directory aSubProgramDirs[0], in ascending order. The first match is used. The first empty directory name ends the search. - bParenthesesAsComments- BOOL- TRUE - Usually, parentheses in g-code are treated as multi-line comments. If bParenthesesAsComments is set to FALSE, however, parentheses can be used in the usual ways to group expressions (‘(a+b)*c’) and for subprogram calls (‘N10 sub(17)’) in g-code. Multi-line comments can be started with ‘(‘ and end with ‘)’. - For more control over the delimiters, call the method SMC_ReadNCFile2.SetDelimiters before calling the main method of this FB. If SetDelimiters is called, this input is ignored. - Note - Regardless of the value of this input, it is always possible to use curly braces ‘{}’ to group expressions and for subprogram calls. - bDisableJumpBuffer- BOOL- This input, if - TRUE, disables an internal jump buffer that is used to improve performance of g-code processing if jumps (G20) are used.- pCustomFunTable- POINTER TO SMC_NC_GFunctionTable - Allows to define custom functions that can be used in G-Code expressions. If there are no custom G-Code functions, this input is null. - aTokenModifier- ARRAY [0..(NUM_PARSER_CHAINS - 1)] OF SMC_ITokenModifier - Optional modifier function blocks that can change the tokens on the fly. This can be used to translate between G-Code dialects. Leave 0 if not needed. Otherwise, set all members of the array to valid function block instances. - aSentenceModifier- ARRAY [0..(NUM_PARSER_CHAINS - 1)] OF SMC_IGSentenceModifier - Optional modifier function blocks that can change the g-code sentences on the fly. This can be used to translate between G-Code dialects. Leave 0 if not needed. Otherwise, set all members of the array to valid function block instances. - Output - bBusy- BOOL- TRUEwhile execution of function block is not finished- bError- BOOL- TRUEsignals that an error has occurred within the function block.- ErrorID- SMC_ERROR- Error identification - errorPos- The source-position where an error has been detected. - ErrorProgramName- STRING- The name of the program where an error has been detected - sentences- The output sentence queue that can be fed into SMC_NCInterpreter. - adwFileSize- ARRAY [0..(NUM_PARSER_CHAINS - 1)] OF DWORD - Size of the file in bytes. - adwPos- ARRAY [0..(NUM_PARSER_CHAINS - 1)] OF DWORD - Current Position of the cursor in the file. 
Methods:
Structure:
