Modifying the Go to work Zero button in Mach4 to raise Z before moving. Similar to Safe Z move in Mach3.
Posted by on 01 August 2016 11:38 AM

-Open the profile you wish to change the button in.

-With Mach disabled, Click on the "operator" tab at the top.

-Then on "edit screen"

-In the "Screen Tree Manager" (top left), click on the wx4, or what ever is listed.  This is the screen  for this profile.

-Down the Coulomb under properties, you will see what look like two "text doc icons".  One is properties,and the other,  looks like it has a lightning bolt through it.  Click on this one.

-Now you should see the first item in the list that appears, is the screen load script.  Click on this, and then click on the box with three dots that shows up.  (this is the edit box)

-The Screen Load script should appear on the screen.  If not,  look for the LUA editor down in the task bar and expand it.  (some times the editor will open in the minimized form.  The editor will need to be expanded before continuing.

-Scroll down to line 210. This will be the (Go To Work Zero function). This function runs here and is called by the Button from the Run Screen.

-Open the .TXT attachment I sent and simply paste this in for your new go to work zero.

-There is a note in the function explaining how it will work. It is now configured for  Z to now  move first to "home", and then X and Y to Work Coordinate Zero.

-Once the edits are complete, Click "File", then "Save". Now close the script editor.

-Click the "Operator" drop down menu again, then "edit screen".  This will exit the screen editor and will prompt  to save the changes, click yes to continue yes. This will return Mach to the run screen in disable mode.

-Enable Mach and  test the newly configured Go To Work Zero Button.


**Click the Link Below to teh MACH SUPPORT CHANNEL to view the supporting video.**

-- Go To Work Zero() function that acts like a safe Z in Mach3
function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0")

--G53 Z0 will send Z "home, Then will send X and Y to Work coords, Zero

    --mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    --mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves

(3 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name: