OK, here's something that might help a little... Sorry I didn't get to it yesterday. Also, there's a line (marked with "**********") that will almost surely not work correctly. I'd fix it myself, but it would seem that I'm pretty rusty at scripting for Mach3. :/
Originally Posted by
Hirudin
...
1. raise the head
2. move the table to the location of the tool setter
3. lower the head (I assume by using a G31 move) down onto the tool setter
4. then compare the Z DRO value against "0"
...
Add this to M6End.m1s
Code:
// Step 1...
Code "G0 G53 Z0" // should raise the head up to machine Z0 (you might want to use "-0.25" or something similar)
// Step 2...
Code "G0 G53 X0 Y0" // should move the table to machine X0Y0 (you'd want to replace these coordinates with the coordinates of the toolsetter)
// Step 3...
If GetOEMLED (825) <> 0 Then // Checks to see if the probe is already activated
Message "Probe is activated. Correct and try again."
Stop // Stops the script if the probe is activated *** -> Code "M0" <- might be a better command to use here ***
Else
FeedBefore = GetOEMDRO(818) // The current feedrate, before the script begins
SearchDist = GetOEMDRO(1012) // The distance you'd like the machine to move down to find the toolsetter. I use a custom DRO but you can replace the variable with a number
FeedSlow = GetOEMDRO(1015) // The feed-rate at which to move toward the probe. I use a custom DRO but you can replace the variable with a number
Code "G31 Z-"&SearchDist &"F"&FeedSlow
While IsMoving()
Sleep 100
Wend
End If
// Step 4...
If GetOEMDRO(802) <> GetVar(2002) Then // ********** this line needs to be fixed **********
Message "Tool length has changed."
Stop // Stops the script if the lengths don't match *** -> Code "M0" <- might be a better command to use here ***
End If
Code "F"&FeedBefore // Restores the feed-rate back to the beginning value
// *** Hopefully the normal ATC script will begin here***