Can one of you clarify this for me. I am currently working on a probing script for Mach4 and as one solution that I was considering for writing the probed z-position of the top of a part was to use something like this "mc.mcCntlGcodeExecuteWait(inst, "G10 P"..wcsVariable.."Z"..zMachinePositionVariableAtTimeOfTrigger)
For simplicity's sake, let's say that wcsVariable = 1 and zMachinePositionVariableAtTimeOfTrigger = -4.685, then this willl obviously become the gcode "G10 P1 Z-4.685" and thus set the the z-zero position of G54 at G53 Z-4.685.
Of course, these variables would be set either by user entry on a GUI screen and/or via the probe trigger action and some preceding script in the code.
My question is regarding the use of the G10 code in particular. Am I correct in thinking that G10, in a situation like my example above, will write the position you give it to whichever axis you tell it to(excluding those you do not specify), and that axis in that work coordinate system is set to that number (in machine coordinates) until it is otherwise changed (as in it would function the same as manually zeroing that same axis in that same work coordinate system in that same position in machine coordinates?
Sorry for being so verbose. To state that more simply, would the above code "G10 P1 Z-4.685" be an equivalent to jogging the machine to G53 Z-4.685 and zeroing the z-axis at that point?
I would prefer to use #variables much in the same way you would on a Haas, or system variables as you would on a Siemens-controller-based machine, but Mach4 does not clearly publish this data. It is findable, but it seems to be that people doubt whether or not these #variables will stay consistent in their application by Mach4 with updates. Also, I could not find a clear way to use lua script to write the machine coordinates to a specific work coordinate axis. So, if you happen to know of a good way to do it this way, I would appreciate any input there as well. Thanks for any input you can give.