I am processing with G Code Enterpolation in my 3 axis machine. The problem is that as the God lines I have processed multiply, the waiting time increases considerably. This is an unwanted situation. For example, when I start reading the 30,000 -line G Code file with the "SMC_NCINTERPETER" block, it throws the lines into the series one by one and starts when you throw it all. I tried to trigger the Enterpolator without reading all the lines, but it didn't work.
And 30,000 lines are actually a low number. There are hundreds of thousands of code to be employed. How can I solve this? Although some of them had the idea of dividing and sending the code, it did not make sense.
Only one question : why dividing by 600 ? shouldn't be 1000 to convert nanoseconds to microseconds ?
And so, how do you determine the 200us for the while loop ?
Just by testing your application to be fast enough to Interprete Gcode while not blocking the rest of your code ?
Thanks again for your help, you saved my day :)
K.B.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good work friends.
I am processing with G Code Enterpolation in my 3 axis machine. The problem is that as the God lines I have processed multiply, the waiting time increases considerably. This is an unwanted situation. For example, when I start reading the 30,000 -line G Code file with the "SMC_NCINTERPETER" block, it throws the lines into the series one by one and starts when you throw it all. I tried to trigger the Enterpolator without reading all the lines, but it didn't work.
And 30,000 lines are actually a low number. There are hundreds of thousands of code to be employed. How can I solve this? Although some of them had the idea of dividing and sending the code, it did not make sense.
Does anyone have any idea?
Thank you.
ByCNC
Last edit: ByCNC 2023-02-22
Hello !
I'm currently facing exactly the same problem you describe!
Did you find a solution to speed up the Interpreter, or to start the Interpolator before the Interpreter finish ?
Thank you very much,
K.B.
Hello,
The solution is;
VAR_TEMP
timeBefore : SYSTIME;
timeAfter : SYSTIME;
udiDuration_us : UDINT;
END_VAR
SysTimeGetNS(timeBefore);
udiDuration_us := 0;
WHILE udiDuration_us < 200 DO
//SMC_ReadNcFile2
fbReadFile(bExecute:=b01dExecute,
bAbort:=gCNC.bCycleStop,
sFileName:=strFileName,
pvl:=ADR(gConsts.stVarList));
//SMC_NcInterpreter.
fbInterpreter(Sentences := fbReadFile.sentences,
bExecute :=,
bAbort := ,
nSizeOutQueue := SIZEOF(astGeoBuffer),
pbyBufferOutQueue := ADR(astGeoBuffer));
END_WHILE
Hello,
Thank you very much that's working really great !
Only one question : why dividing by 600 ? shouldn't be 1000 to convert nanoseconds to microseconds ?
And so, how do you determine the 200us for the while loop ?
Just by testing your application to be fast enough to Interprete Gcode while not blocking the rest of your code ?
Thanks again for your help, you saved my day :)
K.B.
Last edit: kb-tek 2023-06-02
Hello KB,
You can find the optimum value of these values by trial and error. Just so many tries!
Hello KB,
You can find the optimum value of these values by trial and error. Just so many tries!