Is there a mechanism in GC to get notified after a particular move is complete? For example, if I have a routine that sends the following to the queue:
Don’t remember, I think it sends each code as it begins to execute it. A line with multiple gcodes gets broken into separate executions and responses. “Sending G20 G91” for instance receives G20 as one response, G91 as a separate line. It’s been a while since I was deep in the log.txt file, but I remember seeing the “Sending” line getting several lines ahead of the execution response.
I’ll play around with it tomorrow. I need to send a move command to a certain spot and then do something after it gets there. I think the trigger/callback on the Logger class will be easy to implement, but I’m new to Python so sorta winging it. Unfortunately, I generally code on my desktop in my house and the Maslow is in the shed. Now I have to switch to a laptop with a 13-inch screen and go out there and code there… I need to extend usb over wifi…
Also beware that if the “Home” coordinates have been moved away from 0,0, the gcode line sent and acknowledged will have the XY coordinates translated into the new coordinate system and won’t match the line in the source file.
I think it might but from what I can tell its for calling external scripts (I really don’t understand all that’s in the thread, however). I need to incorporate a call back to a GC function. If it can used for that, then great.
Edit: I reread the post and I don’t think it will fit for what I need. It looks like you edit the gcode to add a special command and when GC reaches a certain point, it fires off a script. What I need is something that watches the messages coming back from the arduino and fires off a callback. This could be done in the logger or the serial thread, I believe. I think I have written a way to do it in the logger, but I need to finish loading up a PC to put out in the shed that I can remote desktop into to see if it works. The thought of extensive coding in a shed just gives me chills. I’ve already have a wifi camera out there so I can watch the sled move (no, the router won’t be on during any remote work for those safety hawks )
I added a trigger routine to the logger and it works well. You can set a triggerMessage and triggerCallback and when the logger message equals the Tigger message, it calls the callback.