notification when a specific N-line is executed?

From the original Synthetos forum (2011–2025)

Started by Adam on in TinyG Support. 1 reply, last activity Oct 1, 2015.

#

Hi, I'm talking to the TinyG using JSON mode. What is the best way for my host code to be notified when a specific line of G-code (which has an N-number) has been completed?

Right now the r:{gc:{n:{..}}} responses tell me when that line of G-code has been enqueued for the planner, but I need to know when the line has been *executed*, not when it has been enqueued.

The qr:{} responses let me monitor the fullness/emptiness of the queue, but it seems exceptionally difficult to correlate those numerical fullness/emptiness levels with a precise line of g-code while running at full blast. This is even more difficult because a single G-code line may create more than one queue entry, so the correspondence isn't one-to-one.

This has to be something people use a lot, so I'm guessing there's a simple way to do it that I've missed.

Staff #

What I do know is that Chilipeppr manages to get this done, even with Gcode files without "Nnumbers", I believe by adding it's own.

How it is done is buried in the code.

I don't believe there is a way for you to set a trigger for tinyG to report on a specific line number, likely because Gcode line numbering is optional and somehwat random. It would seem sniffing the status repot stream is the only way.

You could also post a query to:

https://github.com/synthetos/TinyG/issues

This topic is from the original forum (October 2015). Your reply starts a new discussion linked to it.

Reply

Different problem? Ask a new question

Back to TinyG Support or latest activity.