Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: brianhatley on June 01, 2020, 01:43:26 PM
-
upon closing, and reopening. my tool change macro and auto tool zero macros reset to default. i cant figure out why and ita driving me insane.
-
Show us your macro code and we will see.
-
i just made a few text files on my desktop that i can copy/paste because i have to reset them every time i restart. but while the program is up they stay and work fine.
Tool change location just goes to the side of my machine where i can access it easily
M6Start.m1s
tool = GetSelectedTool()
SetCurrentTool( tool )
Code" f400 g53 y -46 z -.2"
for my tool 0 , works great. i have a plate attached to my table at that location and a dro to set the material thickness.
HiddenScript.m1s
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
Plate = .2525 - GetUserDRO(1202)
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
Code "G1 P0" ' this delay gives me time to get from computer to hold probe in place
Code"z2"
Code "f400 g53 x0 y0"
While IsMoving() 'wait while it happens
Wend
Code "G54 Z0"
While IsMoving() 'wait while it happens
Wend
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G90 G31Z-4. F10" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the exact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, Plate) ' change .060 to your plate thickness and then adjust for final accuracy
Sleep 200 'Pause for Dro to update.
Code "G1 Z1 f400" 'put the Z retract height you want here, must be greater than the touch plate thickness
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code"x0 y0"
Code "z0"
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
End If
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
-
just a quick test. shot down Mach3, goto c:\mach3\macros\ your Profile Name\ Folder open M6Start.M1S with a a text Editor copy paste your code and save the file. restart Mach3 and havs a look for teh M6Start.m1s file wether it is still the modified one-
-
okay, so when i do this. the file INSIDE the folder shows correct. but when i open it through mach3 it just reverts back. and changes the file in the mach folder under my profile
-
ok when you say you open it throught Mach you mean Operator -> VBScript Editor ?
-
Yes, or edit button script for auto tool zero. Either way
-
witch Version of Mach3 are you using?
-
I’m not entirely sure, I downloaded it straight from the website around March and I haven’t updated it. It should be the latest since Mach 4 wa already out and I was told Mach 3 was a finished product that was longer getting support
-
try to run this:
https://warp9td.com/index.php/sw/software-mach#MachThree
patched version
-
i just made a few text files on my desktop that i can copy/paste because i have to reset them every time i restart. but while the program is up they stay and work fine.