SMC_ReadNCFile2 (FB)¶
FUNCTION_BLOCK SMC_ReadNCFile2
SMC_ReadNCFile2 can read a NC-ASCII-file from the file system
of the controller in order to make it available for the SMC_NCInterpreter.
Thus, a NC program can be read in and interpreted at runtime.
- InOut:
Scope
Name
Type
Initial
Comment
Input
bExecuteBOOLRising edge: starts execution.
sFileNameSTRING(255)File path of the file containing the g-code.
pvlPOINTER TO SMC_VARLIST
The variable list defines a the type and address for each variable that can be used from the g-code. If there aren’t variables in the g-code, this input isn’t used.
fDefaultVelLREALDefault velocity; used if the velocity (F-word) is not specified inside the CNC file. Note: only applies to the main program, not to subprograms.
fDefaultAccelLREALDefault acceleration; used if acceleration (E+ word) is not specified inside the CNC file Note: only applies to the main program, not to subprograms.
fDefaultDecelLREALDefault deceleration (E- word); used if deceleration is not specified inside the CNC file Note: only applies to the main program, not to subprograms.
fDefaultVelFFLREALDefault 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.
fDefaultAccelFFLREALDefault 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.
fDefaultDecelFFLREALDefault 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.
b3DModeBOOLTRUE
If
TRUE, a G17 command (activation of 3D-mode) is executed implicitly. Note: only applies to the main program, not to subprograms.bStepSuppressBOOLWhen this input is
TRUE, lines of the CNC program starting with ‚/’ will be ignored. Otherwise they will be processed.aSubProgramDirsARRAY [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.
bParenthesesAsCommentsBOOLTRUE
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 ‘)’.
Note
Regardless of the value of this input, it is always possible to use curly braces ‘{}’ to group expressions and for subprogram calls.
bDisableJumpBufferBOOLThis input, if
TRUE, disables an internal jump buffer that is used to improve performance of g-code processing if jumps (G20) are used.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.
ErrorProgramNameSTRINGThe name of the program where an error has been detected
sentencesThe output sentence queue that can be fed into SMC_NCInterpreter.
adwFileSizeARRAY [0..(NUM_PARSER_CHAINS - 1)] OF DWORD
Size of the file in bytes.
adwPosARRAY [0..(NUM_PARSER_CHAINS - 1)] OF DWORD
Current Position of the cursor in the file.