Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Z height probe macro


Guest
 Share

Recommended Posts

I am trying to write a macro to Z height probe.

 

I am going to touch all tools off of the table and I want to use our probe to touch the top of the part, calculate the distance between the table and the top of the part, I set a variable so I can set stock removal amount and set the calculated amount into the correct work offset based on the W callout in the G65 line.

 

Before I try this out can any of you macro guys tell me if this will work.

 

code:

%

(G65 P8300 C2. R.1 W1. Z-.25)

(C = RETRACT HEIGHT)

(R = AMOUNT OF STOCK REMOVAL)

(W = WORK OFFSET NUMBER)

(Z = PROBE HEIGHT)

O8300(Z AXIS POSITION)

(CHECK)

IF[#23GT6]GOTO2

#3004=2

G90G31Z#26F40.

G0G91Z#503

G4P200

G90G31Z#26F.5

G4P100

#100=#5063

#101=#5203

#102=ABS[#101-#100]

#103=#102-#18

G91G0Z#503

G90G1Z#3F60.

#3004=0

N1IF[#23EQ0]GOTO3

#122=5203+[#23*20]

#[#122]=#103

GOTO99

N2#3000=190(WORK SHIFT OFFSET INVALID)

N3#3000=193(WORK OFFSET OUT OF RANGE)

N99M99

%

Link to comment
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...