586,058 active members*
4,270 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    20

    Need to asign a M number to this auto tool zero macro.

    How can I assign a M number to this macro I found that is for the auto tool zero button. I would like to be able to use the button to zero the tool, and I would also like to assign a M-number so that immediately after a tool change, the the macro will be ran, the tool will be zeroed and the program then continue.

    Example :
    M28
    T3 M06 G43 H3
    M99991 (Auto zero's tool)
    M1 (press cycle start to continue)
    G0 z.375
    ......

    Also, I would like to know if after the probe is triggered, does the z axis de-accelerate normally, or does it come to an abrupt stop (like when an e-stop is triggered). I'm afraid the I'll lose steps in absolute coordinates on the z axis with my stepper system.

    Here is the macro I found:

    Put a user DRO on the screen using Mach's screen utility, Screen4. Assigned it OEM code 1151

    Also put a LED for Probe and one for Pause or Dwell. These I will explain later. See the screen grab below as pic.

    Assigned the following macro to the "Auto Tool Zero" button.

    PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

    If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
    DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
    Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
    Code "G31Z-40 F500" '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 axact 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, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
    Code "G4 P0.25" 'Pause for Dro to update.
    Code "G0 Z25.4" 'put the Z retract height you want here
    Code "(Z axis is now zeroed)" 'puts this message in the status bar
    Else
    Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
    Exit Sub
    End If

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    Save the macro as Mxxx.m1s and pu it in Mach3\macros\yourprofile\

    Not sure about the 2nd part, but you can set the feedrate low, so you shouldn't have a problem.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Nov 2011
    Posts
    0

    assign macro

    hi that seems so simple but it does nothing in my screenset I get not yet implemented message in my ststus bar. am I missing something?

  4. #4
    Join Date
    Mar 2003
    Posts
    35538
    If you created an M Code, you need to edit the screen in a screen designer so the button calls that M-Code.

    Or, you use Operator > Edit Button Script, then click on the button, and add the code right to the button.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5
    Join Date
    Nov 2011
    Posts
    0

    m code

    many thanks i have created the m code ok and it works fine I am still not sure how to apply it to a button in the screen set i was using the blue screen but the auto tool zero button seemed to be locked it was not available from operator/edit button/script. however i have gone back to my initial 1024 screen and now i was able to apply the script to the auto tool zero button.

    Hurray!! many many thanks

Similar Threads

  1. Fanuc Serial Number Macro
    By TomL21 in forum Parametric Programing
    Replies: 15
    Last Post: 04-23-2024, 06:16 AM
  2. number engraving macro
    By gravy in forum Parametric Programing
    Replies: 2
    Last Post: 02-22-2010, 11:05 PM
  3. Tool Serial Number Lookup
    By jcollazo in forum Calibration / Measurement
    Replies: 1
    Last Post: 10-06-2008, 08:23 PM
  4. Missing Tool Number
    By barbter in forum NCPlot G-Code editor / backplotter
    Replies: 1
    Last Post: 10-04-2008, 04:07 PM
  5. Dx-32 auto N number for you
    By jtree83 in forum Bridgeport / Hardinge Mills
    Replies: 4
    Last Post: 09-26-2005, 07:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •