1. If you call Code, the execution comes back to your program and there can be a delay before ismoving() gets true.
2. If you call Codesync, the execution comes back only when the code is compiled and sent to the motion buffer. When something gets into the buffer, the ismoving() will return true.
I will do some test : as you said : Codesync does not wait for the end of the (possible) motion.
As you said it : "Codesync get back to you when the gcode is compiled and sent to the controler"
I will confirm this. But because i call Code or Codesync from the plugin loop, i could just simply always use codesync there, beeing sure that ismoving==true.
I thought that codesync was returning at the end of the (possible) motion of the CNC.
Thanks to you all for this fair help !
As soon as i get confirmation of the quality of my method, i will send you the effective result : in my plugin i do lot of probing, then apply to the code : probing is not done in the generated code. Z are directly offseted.
i do many other things, but my main idea at the beginning was to rewrite the Autoleveler from Caties, and to add lots of additionnal features:
- Apply offset and rotation, allow any probes , plus "probes in selection", manual addition of probe with mouse , delete of a specific probe (if the probe fall in a hole in the stock !) with right click etc...
and finally, for now, djiskra optimisation of the drillings, because i do PCB's...
Thanks again, guys
Seb