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:

Work Offset & Tool Length macro


Recommended Posts

Hello everyone,
   I have a NIIGATA HORIZONTAL and it is pretty much using MACRO.  Right now I have to edit by hand as the MACRO #530 for the tool length offset.  I also would like to find the macro # for work offset.  like this...

 

 

 


Thank you for the info

==================================================================

%
O1234(0042-22098 REV02-FIXTURE.nc)
(SOURCE = 0042-22098 REV02.MCAM)
(POSTED ON MAR.24.2020 AT 6*04AM)
(STEVEN LUONG, BY= NMTW\SLUONG)
(*)
(304 STAINLESS, BAR STOCK = X15.00 Y15.00 Z1.00)
(TOTAL TOOLS FOR FIXTURE = 8 TOOLS)
#530 = 1 (T1= .5, 1/2 EM, U, 3FLTS CB * Z0.)                       =============> Good code
#530 = 2 (T2= .5, 1/2 SPOTTER, * Z-.1825)                           =============> Good code
#530 = 3 (T3= .201, #7 STUB DRILL, * Z-.7104)                   =============> Good code
#530 = 4 (T4= .25, 1/4-20 CUT TAP, * Z-.5)                           =============> Good code
#530 = 5 (T5= .242, LTR. C STUB DRILL, * Z-.7127)             =============> Good code
#530 = 6 (T6= .3125, 5/16 STUB DRILL, * Z-.8589)             =============> Good code
#530 = 7 (T7= .251, .2510 REAMER, * Z-.5)                          =============> Good code
#530 = 8 (T8= .375, 3/8-16 CUT TAP, * Z-.515)                   =============> Good code
(*)
(WORK OFFSET LIST)
(G54)              =============> What is the macro# for the work offset number?
(XY0 = CENTER)
(Z0 = -.015 CLEAN UP)
(*)
(CYCLE TIME = 26M 51.91S)
(*)
N1(SKIM TOP SURFACE, CUT#1)
G0 G17 G40 G49 G80 G90(13M 24.82S)
G91 G28 Z0 M19(Z STK= .005)
G17(XY PLANE) G28 Y0.
T=#530 M6(.5000,1/2 EM, U, CB, 2.000RLF,)            =============> Good code
G90 G54 S4000 M3 (.375 MAX., 75PERC STPOVR)
X-8.05 Y7.3749
G43 H=#530 Z1. T2 M8(DOC= Z.005)                        =============> Good code
G17(XY PLANE) G90 Z.0675

Link to comment
Share on other sites

Steven you just need to define that as a variable string and then use it.

Here are some I defined some years ago from probing on an Integrex:

strg659530   : "G65P9530" #Printing Macro Call for B90
strg659532   : "G65P9532" #Offset Update Macro for B90
strg659610   : "G65P9610" #Probe Protect Cycle for B90
strg659611   : "G65P9611" #XYZ Single Surface Measure B90
strg659612   : "G65P9612" #Web / Pocket Measure B90
strg659614   : "G65P9614" #Bore / Boss B90
strg659618   : "G65P9618" #C Axis Measure - Vertical B90
strg659619   : "G65P9619" #Bore / Boss on PCD B90
strg659621   : "G65P9621" #Angle Single Surface Measure B90
strg659622   : "G65P9622" #Angle Web / Pocket Measure B90
strg659623   : "G65P9623" #3-Point Bore / Boss Measure B90
strg659634   : "G65P9634" #Feature to Feature Measure B90
strg659650   : "G65P9650" #C-Axis Measure - Vertical B90
strg659730   : "G65P9730" #Printing Macro Call for B0
strg659732   : "G65P9732" #Offset Update Macro for B0
strg659810   : "G65P9810" #Probe Protect Cycle for B0
strg659811   : "G65P9811" #XYZ Single Surface Measure B0
strg659812   : "G65P9812" #Web / Pocket Measure B0
strg659814   : "G65P9814" #Bore / Boss B0
strg659818   : "G65P9818" #C Axis Measure - Horizontal B0
strg659819   : "G65P9819" #Bore / Boss on PCD B0
strg659821   : "G65P9821" #Angle Single Surface Measure B0
strg659822   : "G65P9822" #Angle Web / Pocket Measure B0
strg659823   : "G65P9823" #3-Point Bore / Boss Measure B0
strg659834   : "G65P9834" #Feature to Feature Measure B0
strg659850   : "G65P9850" #C-Axis Measure - Horizontal B0

It is a Fanuc control? If so then the standard Parameters should apply to look up the variable. You can always do the old school process of defining the variable at the start?

Are you looking to do the G10 G90 L2 P1 X.5312 Y11.284 Z.917 B0. to define the G54 from the start?

  • Like 1
Link to comment
Share on other sites
  • 1 month later...
On 3/24/2020 at 5:53 PM, 5th Axis CGI said:

Steven you just need to define that as a variable string and then use it.

Here are some I defined some years ago from probing on an Integrex:


strg659530   : "G65P9530" #Printing Macro Call for B90
strg659532   : "G65P9532" #Offset Update Macro for B90
strg659610   : "G65P9610" #Probe Protect Cycle for B90
strg659611   : "G65P9611" #XYZ Single Surface Measure B90
strg659612   : "G65P9612" #Web / Pocket Measure B90
strg659614   : "G65P9614" #Bore / Boss B90
strg659618   : "G65P9618" #C Axis Measure - Vertical B90
strg659619   : "G65P9619" #Bore / Boss on PCD B90
strg659621   : "G65P9621" #Angle Single Surface Measure B90
strg659622   : "G65P9622" #Angle Web / Pocket Measure B90
strg659623   : "G65P9623" #3-Point Bore / Boss Measure B90
strg659634   : "G65P9634" #Feature to Feature Measure B90
strg659650   : "G65P9650" #C-Axis Measure - Vertical B90
strg659730   : "G65P9730" #Printing Macro Call for B0
strg659732   : "G65P9732" #Offset Update Macro for B0
strg659810   : "G65P9810" #Probe Protect Cycle for B0
strg659811   : "G65P9811" #XYZ Single Surface Measure B0
strg659812   : "G65P9812" #Web / Pocket Measure B0
strg659814   : "G65P9814" #Bore / Boss B0
strg659818   : "G65P9818" #C Axis Measure - Horizontal B0
strg659819   : "G65P9819" #Bore / Boss on PCD B0
strg659821   : "G65P9821" #Angle Single Surface Measure B0
strg659822   : "G65P9822" #Angle Web / Pocket Measure B0
strg659823   : "G65P9823" #3-Point Bore / Boss Measure B0
strg659834   : "G65P9834" #Feature to Feature Measure B0
strg659850   : "G65P9850" #C-Axis Measure - Horizontal B0

It is a Fanuc control? If so then the standard Parameters should apply to look up the variable. You can always do the old school process of defining the variable at the start?

Are you looking to do the G10 G90 L2 P1 X.5312 Y11.284 Z.917 B0. to define the G54 from the start?

This is what I meant... some one knows lots of macros and showed me...

IF [#[#505+2000] EQ 0] GOTOM30 (IF TOOL LENGTH OFFSET IS ZERO)

 

I also would like to check if 
 IF T#  <> H# GOTOM30 (CHECK IF T# NOT SAME AS H#) safety.

 

If you know, please let me know. 

 

 

Example...

%
O3240(AMAT-0021-10302 REVA- OP40.nc)
(SOURCE = 0021-10302 REVA.MCAM)
(POSTED ON APR.27.2020 AT 15*20PM)
(STEVEN LUONG, BY= NMTW\SLUONG)
(*)
(ALUM 6061-T6, BAR STOCK = X9.50 Y8.38 Z.75)
(NOTE= PROTOTYPE)
(*)
(*)
(TOTAL TOOLS FOR RPT-INDEX = 1 TOTAL TOOL)
(T17= .5, 1/2 EM, 3FLTS CBD * Z-.48)
(*)
(WORK OFFSET LIST)
(G54 A90.)
(*)
(CYCLE TIME = 35.97S)
(*)
N17(ROUGH OUT 1X RIGHT .448 DIAMETER BOSS, CUT#61)
G0 G17 G40 G49 G80 G90(7.56S)
G91 G28 Z0 M19(XY STK= .005)
G28 Y0. 
G0 G90 A270.
IF [#[#505+2000] EQ 0] GOTOM30 (IF TOOL LENGTH OFFSET IS ZERO)  ==========> this is what i meant....
T17 M6(.5000,1/2 EM, CBD,)
G90 G54 S6500 M3
(5X, RMULTI-PASSES, .0313 EACH)
G64(HAAS SLOW AT CORNERS ON)
G43 H17 Z1. M8(DOC= Z-.48)
/G4 P2.5
G90 X-1.076 Y2.068 Z.0625
G1 Z-.48 F25.
X-.8685 Y1.9286

G1 X.5033 Y2.0595
G0 Z1.
M9
G61(HAAS CORNERS DECELERATING OFF)
G91 G28 Z0.
G28 Y0. M5
G0 G90 A270.
M30(1,566 CHARACTERS = 1.57KB)
%
Link to comment
Share on other sites
On 4/27/2020 at 3:19 PM, PcRobotic said:

This is what I meant... some one knows lots of macros and showed me...


IF [#[#505+2000] EQ 0] GOTOM30 (IF TOOL LENGTH OFFSET IS ZERO)

 

I also would like to check if 
 IF T#  <> H# GOTOM30 (CHECK IF T# NOT SAME AS H#) safety.

 

If you know, please let me know. 

 

 

Example...


%
O3240(AMAT-0021-10302 REVA- OP40.nc)
(SOURCE = 0021-10302 REVA.MCAM)
(POSTED ON APR.27.2020 AT 15*20PM)
(STEVEN LUONG, BY= NMTW\SLUONG)
(*)
(ALUM 6061-T6, BAR STOCK = X9.50 Y8.38 Z.75)
(NOTE= PROTOTYPE)
(*)
(*)
(TOTAL TOOLS FOR RPT-INDEX = 1 TOTAL TOOL)
(T17= .5, 1/2 EM, 3FLTS CBD * Z-.48)
(*)
(WORK OFFSET LIST)
(G54 A90.)
(*)
(CYCLE TIME = 35.97S)
(*)
N17(ROUGH OUT 1X RIGHT .448 DIAMETER BOSS, CUT#61)
G0 G17 G40 G49 G80 G90(7.56S)
G91 G28 Z0 M19(XY STK= .005)
G28 Y0. 
G0 G90 A270.
IF [#[#505+2000] EQ 0] GOTOM30 (IF TOOL LENGTH OFFSET IS ZERO)  ==========> this is what i meant....
T17 M6(.5000,1/2 EM, CBD,)
G90 G54 S6500 M3
(5X, RMULTI-PASSES, .0313 EACH)
G64(HAAS SLOW AT CORNERS ON)
G43 H17 Z1. M8(DOC= Z-.48)
/G4 P2.5
G90 X-1.076 Y2.068 Z.0625
G1 Z-.48 F25.
X-.8685 Y1.9286

G1 X.5033 Y2.0595
G0 Z1.
M9
G61(HAAS CORNERS DECELERATING OFF)
G91 G28 Z0.
G28 Y0. M5
G0 G90 A270.
M30(1,566 CHARACTERS = 1.57KB)
%

O8700<(TOOL LENGHT AFFIRMATION)
(TEST FOR G43 VALUE) 
(OVERWRITE H# WITH T# IF NEED) 
(TEST FOR A TOOL LENGHT VALUE LESS THAN 2.0", EQUAL TO ZERO, OR NULL VALUE)
(-----------------------------------------)
(LASTEST CHANGES 10/08/2013) 
(----- PROGRAM CREATED -----)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--CHANGED THE MINIMUN ALLOWED--)
(--TOOL HEIGHT 2.0" MIN.--)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--ADDED A TEMPORARY WCS CHECK--)
(--TO ALLOW PROGRAMS WITH G59 ONLY--)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--MODIFIED THE "WCS CHECK" TO VERIFY CONCURRENCY--) 
(--BETWEN POSTED W.O. AND TARGET W.O. ONLY--)
(---W.O.= WORK OFFSET-----------------------)
(-----------------------------------------)
(LASTEST CHANGES 07/19/2018) 
(--MACRO PROGRAM ADAPTED FOR MAKINO S33--) 
(-----------------------------------------)
IF[#4014EQ#0]THEN#3000=159(-WORK OFFSET MISSING-)
IF[#4014EQ0]THEN#3000=158(-WORK OFFSET MISSING-)
IF[#4014LE54.0]THEN#3000=157(-WORK OFFSET NOT 54-) 
IF[#4008NE43]GOTO665(IS G43 ACTIVE? )
 IF[#4120EQ0]GOTO664(IS T# EQUAL TO 0)
IF[#4120EQ#0]GOTO664(IS T# EQUAL TO NULL)
IF[#4111EQ#4120]GOTO555(IS H# EQUAL TO T#) 
#3000=176(T AND H NUMBERS NOT THE SAME)
G91G28Z0.(RETRACT HOME)
G49(CANCEL TOOL LENGTH COMPENSATION) 
G43H#4120(ACTIVATE TOOL LENGTH COMPENSATION)
N555 
IF[ABS[#5083]LT1.0]GOTO666(IS TOOL HEIGHT LESS THAN 1.0) 
IF[#5083EQ0]GOTO666(IS TOOL HEIGHT EQUAL TO 0.0) 
IF[#5083EQ#0]GOTO666(IS TOOL HEIGHT NULL)
GOTO777(N777)
N664#3006=175(T# IS NOT EQUAL TO H#) 
GOTO777(GO TO N777)
N665#3000=175(**ERROR** --MISSING G43--) 
GOTO777(N777)
N666#3000=176(TOOL HEIGHT LESS THAN 1")
N777 
M99

 

Seems like this is the sort of thing you are looking for.

This is one of the macros I have created and it is used as a safety subprogram routine and part of the machining process in 6 different fanuc, and fanuc based controls and It is a deletion protected program that gets call out for every tool, before the tool goes down on Z. 

You would have to include in you post processor a output a call to the 8700 subprogram.

Please note that you need to adjust accordingly  to fit your machine.  

 Feel Free.

 

 

  • Like 1
Link to comment
Share on other sites
On 5/2/2020 at 8:46 AM, Compaq007 said:

O8700<(TOOL LENGHT AFFIRMATION)
(TEST FOR G43 VALUE) 
(OVERWRITE H# WITH T# IF NEED) 
(TEST FOR A TOOL LENGHT VALUE LESS THAN 2.0", EQUAL TO ZERO, OR NULL VALUE)
(-----------------------------------------)
(LASTEST CHANGES 10/08/2013) 
(----- PROGRAM CREATED -----)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--CHANGED THE MINIMUN ALLOWED--)
(--TOOL HEIGHT 2.0" MIN.--)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--ADDED A TEMPORARY WCS CHECK--)
(--TO ALLOW PROGRAMS WITH G59 ONLY--)
(-----------------------------------------)
(LASTEST CHANGES 07/17/2018) 
(--MODIFIED THE "WCS CHECK" TO VERIFY CONCURRENCY--) 
(--BETWEN POSTED W.O. AND TARGET W.O. ONLY--)
(---W.O.= WORK OFFSET-----------------------)
(-----------------------------------------)
(LASTEST CHANGES 07/19/2018) 
(--MACRO PROGRAM ADAPTED FOR MAKINO S33--) 
(-----------------------------------------)
IF[#4014EQ#0]THEN#3000=159(-WORK OFFSET MISSING-)
IF[#4014EQ0]THEN#3000=158(-WORK OFFSET MISSING-)
IF[#4014LE54.0]THEN#3000=157(-WORK OFFSET NOT 54-) 
IF[#4008NE43]GOTO665(IS G43 ACTIVE? )
 IF[#4120EQ0]GOTO664(IS T# EQUAL TO 0)
IF[#4120EQ#0]GOTO664(IS T# EQUAL TO NULL)
IF[#4111EQ#4120]GOTO555(IS H# EQUAL TO T#) 
#3000=176(T AND H NUMBERS NOT THE SAME)
G91G28Z0.(RETRACT HOME)
G49(CANCEL TOOL LENGTH COMPENSATION) 
G43H#4120(ACTIVATE TOOL LENGTH COMPENSATION)
N555 
IF[ABS[#5083]LT1.0]GOTO666(IS TOOL HEIGHT LESS THAN 1.0) 
IF[#5083EQ0]GOTO666(IS TOOL HEIGHT EQUAL TO 0.0) 
IF[#5083EQ#0]GOTO666(IS TOOL HEIGHT NULL)
GOTO777(N777)
N664#3006=175(T# IS NOT EQUAL TO H#) 
GOTO777(GO TO N777)
N665#3000=175(**ERROR** --MISSING G43--) 
GOTO777(N777)
N666#3000=176(TOOL HEIGHT LESS THAN 1")
N777 
M99

 

Seems like this is the sort of thing you are looking for.

This is one of the macros I have created and it is used as a safety subprogram routine and part of the machining process in 6 different fanuc, and fanuc based controls and It is a deletion protected program that gets call out for every tool, before the tool goes down on Z. 

You would have to include in you post processor a output a call to the 8700 subprogram.

Please note that you need to adjust accordingly  to fit your machine.  

 Feel Free.

 

 

Thank you these valuable info.  Surely, I will put those in my post.  I would like to understand them.  

IF[#4014EQ#0]THEN#3000=159(-WORK OFFSET MISSING-)   ======> What is #4014 value stand for? Is this a constant value?
IF[#4014EQ0]THEN#3000=158(-WORK OFFSET MISSING-) 
IF[#4014LE54.0]THEN#3000=157(-WORK OFFSET NOT 54-) 
IF[#4008NE43]GOTO665(IS G43 ACTIVE? )                                 ======> What is #4014 value stand for? Is this a constant value?
 IF[#4120EQ0]GOTO664(IS T# EQUAL TO 0)                             ======> What is #4020 value stand for? Does it represent as T#?
IF[#4120EQ#0]GOTO664(IS T# EQUAL TO NULL)
IF[#4111EQ#4120]GOTO555(IS H# EQUAL TO T#)                 ======> What is #4111 value stand for? Is this a constant value?

Link to comment
Share on other sites
  • 6 months later...
3 minutes ago, byte me said:

I wonder if sharing posts is even allowed.

If someone has a post and wants to share it...that's on them....there's a myriad of reasons why you shouldn't but, if it's their work, their call.

Binned posts can't be shared for obvious reasons.

I have offered to share a post with a user, all I asked was that they had their reseller contact me and I would provide it to them, they could provide it to the user..that user has been banned from this site as being shown to be used pirated software.

Though there are users on here known to me that I would without hesitation share a post with them.

Link to comment
Share on other sites
10 minutes ago, byte me said:

I wonder if sharing posts is even allowed.

Sure do it all the time with Legal users. I have topic after topic of information I have shared over the years. I just did some hacking this weekend on a Postability post adding some CANTEXT stuff do some back spot facing where the tools had to be hand loaded. That work was shared with them and their copy is aligned with the customer and all is good. 

  • Thanks 1
Link to comment
Share on other sites
On 2020/11/11 at AM4点20分, crazy^millman said:

您吸引了他的时间和实力,然后回过头来自由分享工作,没有人阻止您。 祝你有美好的一天。

您占领他的时间和实力,然后自由地分享工作,没有人阻止您。 祝你有美好的一天。

Thank you for your guidance.

Link to comment
Share on other sites

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...