Step 1. ADD this line to the wincnc.ini file. G37=X# Y# D# F# X=x position of tool measure switch Y=y position of tool measure switch D=rapid plunge distance F=feed rate to approach the tool measure switch Step 2. Open WinCNC and lower the tool to the table top. Run the G37Cal file. This will store the offset between the table and the switch. You will only need to run G37Cal after the table top is altered or if the tool measure switch is moved. Step 3. You can now measure tools automatically by typing G37Z or G37W. Using the G37Z or G37W files will set the zero position for the respective axis to the top of the table.