terjeio / GRBL_MPG_DRO_BoosterPack

Tiva C BoosterPack for GRBL MPG/DRO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the issue of sending G-code with GRBL_MPG_DRO

CHTUZKI opened this issue · comments

HI.
I am trying the GRBL_MPG_DRO project and using a TIVA-C board. I have some questions about the logic of sending G-code from the TIVA-C board. Can I use the grblSendSerial() function in a while loop to continuously send G-code from the TIVA-C board? Will grblHAL lose G-code if the TIVA-C board sends too fast? I noticed that iosender sends G-code line by line to grblHAL, and grblHAL returns an OK to iosender after receiving each line of G-code. I am curious if there is a delay between each line of G-code sent by iosender, which may cause grblHAL to run smoothly or not. Does grblHAL have a buffer that can store multiple lines of G-code at once to avoid delays between each line of G-code?

best regards.

Can I use the grblSendSerial() function in a while loop to continuously send G-code

Yes and no. You have to wait for the "ok" response before sending the next line. Or use the character counting method to ensure that the controller buffer does not overflow.

There is a sender canvas that you can use for transmission, this takes a pointer to a function that delivers the next line of gcode to the sender. The sender will call this function to get the next line (block) when it is safe to send it.
IIRC the sender handles feed hold, abort etc.

Does grblHAL have a buffer that can store multiple lines of G-code at once to avoid delays between each line of G-code?

Yes, most grblHAL controllers has a 1Kbyte buffer. The size is available in the $I response. The Bf: element in the realtime report contains number of free characters in the buffer.