Hybrid View
-
18-03-2014 #1
Hi,
Have a look at these files.
Copy the code below into your clipboard.
Graphic 1 is the Offsets screen where you put in the plate height, in my case 23.97mm
On the main screen as shown in graphic 2 it shows the drop down 'Operator' and from that list select 'Edit Button Script'
Various buttons on the screen will flash, Click on 'Auto Tool Zero'
a window will open and whatever is in it select it all and paste over it with the clipboard contents from step 1. This is shown below. File, Save and Close the Script window.
'Tool Zero Setting Macro
' Change the following three lines to suit your machine
PlateThickness = GetOEMDRO(1001) ' Thickness of touch plate - leave this line, it is the value in the gage block height
RetractClearance = 10 ' Clearance above touch plate to retract to
ProbeFeed = 20 ' Feedrate to use for probing
' Define some constants
ZDRO = 2 ' Z Axis DRO
AbsoluteModeLED = 48 ' Absolute Coordinate Mode LED
IncrementalModeLED = 49 ' Incremental Coordinate Mode LED
FeedrateDRO = 818 ' OEM code for feedrate DRO
ProbeLED = 825 ' OEM code for probe input LED
ZTouchDRO = 2002 ' OEM code for DRO that holds Z touch position
' Do nothing if probe is already grounded
If GetOemLed(ProbeLED) = 0 Then
' Wait a few seconds for user to get touchplate in place
Code "G4 P2"
' Save current feedrate
CurrentFeed = GetOemDRO(FeedrateDRO)
' Save current coordinate mode
AbsMode = GetOemLED(AbsoluteModeLED)
' Set absolute coordinate mode
Code "G90"
' Zero Z DRO
Call SetDro (ZDRO, 0.0000)
' Pause for DRO to update
Code "G4 P0.5"
' Do the touch move
Code "G31 Z-20 F" & ProbeFeed
' Wait for it to complete
While IsMoving()
Wend
' Delay a bit for
Code "G4 P0.25"
' Get the Z position where probe input triggered
ZProbePos = GetVar(ZTouchDRO)
' Go back to touch position (G31 backs off after touch)
Code "G0 Z" & ZProbePos
' Wait for it to complete
While IsMoving ()
Wend
' Set Z DRO to touch plate thickness
Call SetDro (ZDRO, PlateThickness)
' Pause for DRO to update
'Code "G4 P0.5"
' Retract Z to SafeZ, if enabled, else to RetractClearance above plate
If(IsSafeZ() = 1) Then
SafeZ = GetSafeZ
If SafeZ > PlateThickness Then
GotoSafeZ()
End If
Else
RetractHeight = PlateThickness + RetractClearance
Code "G0 Z" & RetractHeight
End If
' Tell user we're done
Code "(Z axis is now zeroed)"
' Reset feedrate to original value
Code "F" & CurrentFeed
' Reset coordinate mode to original value
If AbsMode = 0 Then
Code "G91"
End If
Else
Code "(Z-Plate is grounded, check connection and try again)"
End If
Exit Sub
.............
I have assumed a certain level of knowledge of Mach3 and Windows.
Remember you have the emergency stop if you think it is going wrong when you test.
Best regards,
Rob Townshend
I still remember what it was like when I was first learning Mach3 and CNC
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
1/4" / 6mm edge finder?
By jcb121 in forum Marketplace DiscussionReplies: 0Last Post: 18-03-2013, 02:58 PM -
Need some money making project ideas
By Fivetide in forum Marketplace DiscussionReplies: 10Last Post: 23-11-2012, 09:50 AM -
Making Aluminum offcuts - what tool?
By lateAtNight in forum Tool & Tooling TechnologyReplies: 15Last Post: 28-07-2012, 02:44 PM -
Electronic edge finder: how do they work?
By irving2008 in forum Probing, Digitizing & ScaningReplies: 14Last Post: 29-08-2009, 10:25 PM
Bookmarks