I was already waiting for CheckDoneBuf() to go true, to signify the end of the previous command, but I'm guessing there is some overlap between the buffer emptying, and KMCNC becoming ready for the next MDI?
If I was to improve this, I guess it would be a case of checking for the PC_COMM_PERSIST persist to go greater than 0 before sending the next command?
During the DoPC command, at what point does PC_COMM_PERSIST get set to 0?
The reason I ask, is with also needing to get/set offsets, I should really add some kind of check to ensure KMCNC is not currently handling some other command, before sending another command.
Yes, I think I would need to ultimately know all of the offsets.Yes I expected that more commands would be needed. The DROs should basically be:
Machine Coordinates = DRO + Fixture Offset + Global Offset + Tool Offset
DRO = Machine Coordinates - Fixture Offset - Global Offset - Tool Offset
I would think you would need to know all the offsets instead of the DRO value.
My initial thoughts are I would like to be able to select the offset in my app, and possibly show what offsets are in effect to get the current DRO displays. I think there would also need to be some level of communication between KMCNC and my app to update if offsets are changed in either during a probe routine.
However, that's a bit away yet.
My current plan is, get basic corner probing working, which needs handling offsets and move planning (this is the current thing that's bouncing around my head, as I want a setup that isn't going to need a major re-work for future probing routines).
Then work on alignment/edge probing, which will involve creating a basic geometric correction file to allow for angular offsets.
Then expand the basic probing routines to include the various other options that might be needed aka bore/spigot/slot/ridge probing.
After that, I'll get onto probe radius/offset correction.