I am working to fully understand the macro.cnc from Sorotec and translate version (2.1e) to english in the process. I am trying to fully explain each line using comments and I am completely tripped up in the tool measurement sub routine (sub user_2).
I am referencing Schallbert 's amazing website on macros and there seem to be some extra lines in the Sorotec version I want to understand.
Can someone help me understand how the machine knows the probe measurement (#5053) without issuing a G92 command at the sensor trigger point?
Specifically, why does the machine move to safeZ and then do the measurement calculations:
IF [#5067 == 1]
G53 G0 z[#4506]
#[5400 + #5016] = 0
#[5500 + #5016] = 0
#5021 = [#5053 - #4509]
msg "Tool Length = " #5021
IF [#3501 == 1]
#4502 = [#4501]
#4501 = [#5021]
#3502 = [#4501 - #4502]
G92 Z[#5003 - #3502]
Here's the whole code from after the machine is moved to the sensor: