Streaming of Large G-Code Files

runFile

runFile(path:= string)

The size of files that can be executed employing the GST-interpreter is limited. However, sometimes it is required to execute large files that may have been created e.g. by a CAD-program. Therefore, the user has the possibility to execute filestreams of native G-Code.

Executes the plain G-Code that is contained in the G-Code file given by path. The function call returns after all lines in the supplied file have been processed. The function is intended for streaming large G-Code files to the NC-kernel efficiently.

Streaming of Large G-Code Files 1:

Native G-Code: No Structured Text Allowed

Note that the supplied G-Code file must not contain any ST-elements, but only plain G-Code.

A G-Code filestream from file 'myNativeGCodeFile.nc' can be called from a GST-program lining up the following syntax:

!runfile('myNativeGCodeFile.nc');

runFile with R parameters and simple arithmetic expressions

From the TwinCAT V3.1.4024.40 R parameters and simple arithmetic expressions are allowed with runfile.

callRunfileWithRParamsAndExpressions.nc

N0 G0 X0 Y0 Z0
N1 G1 X10 F5000
!R3:=3;
!R5:=5;
!R10:=15;
!r100:=-1.234;
!R888:=98.123;
N2 G1 y={r100}
!runfile(RunfileWithRParamsAndExpressions.nc');
M30

RunfileWithRParamsAndExpressions.nc

G1 X200
G1 Y150
G1 Z234
G1 z = R888 - r100 - r100 / R10
G1 y=100-r888
G1 x=-R10/r5-r3 q1=20-r3*R5