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:

Transform Toolpaths, Custom Parameter User Defnied


Recommended Posts

Hello everyone,
   I am now working in a company that is ALL BIG MACHINES, VF2, VF6, VF9, VF11.  Since the table is GIANT so we have so much space to put vises on for many work orders.  One of the issues we have is the table CENTER where we wanted when doing TRANSFORM TOOLPATHS. 

 

     Therefore, I wrote this code and it will be X CENTER at the demand of the operator.  Avoiding falling into the table as well where we can not reach the part.  Very dangerous.  Not sure if you guys like it but for me SAFETY IS FIRST.

 

Have a good weekend you guys....

20190905_162255.thumb.jpg.da59da3ba54332560c4963fd81bb68c4.jpg1.thumb.png.eb6c53ef1324dc381911c616b65814db.png

 

 

 

=======G-CODE===============

%
O0369(258369 RevA - OP2.nc)
(SOURCE = 258369 REVA.MCAM)
(POSTED ON SEP.07.2019 AT 7*02AM)
(SLUONG, BY= PCROBOTIC\ADMIN)
(*)
(ALUM 6061-T6, BAR STOCK = X5.50 Y3.50 Z1.50)
(NOTE= PROTOTYPE)
(*)
(TOTAL TOOLS FOR Top = 2 TOOLS)
(T1= 2., 2"  FACE MILL 4FLTS CB * Z0.)
(T8= .75, 3/4 FLAT ENDMILL CB * Z0.)
(*)
(WORK OFFSET LIST)
(G54)
(X0 = LEFT)
(Y0 = FRONT)
(Z0 = TOP)
(*)
(TRANSFORMED TOOLPATHS)
(CYCLE TIME = 01M 37.97S)
(2X PARTS PER RUN, 10. APART)
(*)
N1(SKIM TOP OFF, CUT#5)
G0 G17 G40 G49 G80 G90(22.S)
G91 G28 Z0 M19
G28 Y0.
T1 M6(2.0000,2"  FACE MILL, U, CB, 2.000RLF,)
G90 G54 S4500 M3 (1.5 MAX., 75PERC STPOVR)
X-2.225 Y3.0249
G43 H1 Z1. T8 M8(DOC= Z0.)
G17(XY PLANE) G90 Z.0625
G1 Z0. F100.
()
G0 Z1.
N102(TRANSFORMED TOOLPATHS)
(2.0000,2"  FACE MILL, U, CB, 2.000RLF,)
/G43(D1) H1 Z1.(DOC= Z0.)
/G90 G54 S4500 M3
/X7.775 Y3.0249
/Z.0625
/G1 Z0. F100.
(CUTTING...)
/G0 Z1.
M9
G91 G28 Z0.
G28 Y0. M5
G0 G90 G53 X15.     =========> X CENTER TABLE
M1
(*)
N8(ROUGH AND FINISH PROFILE, CUT#6)
G0 G17 G40 G49 G80 G90(26.93S)
G91 G28 Z0 M19
G28 Y0.
T8 M6(.7500,3/4 FLAT ENDMILL, U, CB,)
G90 G54 S7500 M3(1X FDEPTH CUTS, 0. PER)
X5.0125 Y-.75
G43(D8)H8 Z1. T1 M8(DOC= Z0.)
G17(XY PLANE) G90 Z.0625
G1 Z0. F50.
G41 D8 X5.3875
G3 X5.0125 Y-.375 I-.375
(CUTTING...)
G1 G40 X4.8625
G0 Z1.
N802(TRANSFORMED TOOLPATHS)
(.7500,3/4 FLAT ENDMILL, U, CB,)
/G43(D8) H8 Z1.(DOC= Z0.)
/G90 G54 S7500 M3
/X15.0125
/Z.0625
/G1 Z0. F50.
/G41 D8 X15.3875
/G3 X15.0125 Y-.375 I-.375
(CUTTING...)
/G0 Z1.
M9
G91 G28 Z0.
G28 Y0. M5
G0 G90 G53 X15.
M1
T1 M6(2.0000, 2"  FACE MILL)
G0 G90 G53 X15.     =========> X CENTER TABLE
M30(2,133 CHARACTERS = 2.14KB)
%

 

=======CODE DEFINED==========

iTransType : 0
iTransMeth : 0

TransformToolPathCustomParameterIntegers1: 0
TransformToolPathCustomParameterIntegers2: 0
TransformToolPathCustomParameterIntegers3: 0
TransformToolPathCustomParameterIntegers4: 0

TransformToolPathCustomParameterReals1: 0
TransformToolPathCustomParameterReals2: 0
TransformToolPathCustomParameterReals3: 0
TransformToolPathCustomParameterReals4: 0

fmt    4 TransformToolPathCustomParameterIO
fmt    2 TransformToolPathCustomParameterIntegers1
fmt    2 TransformToolPathCustomParameterIntegers2
fmt    2 TransformToolPathCustomParameterIntegers3
fmt    2 TransformToolPathCustomParameterIntegers4

fmt    2 TransformToolPathCustomParameterReals1
fmt    2 TransformToolPathCustomParameterReals2
fmt    2 TransformToolPathCustomParameterReals3
fmt    2 TransformToolPathCustomParameterReals4


if prmcode$ = 15004, iTransMeth = rpar(sparameter$, 1)
if prmcode$ = 15557,
 [ 
  iTransType = rpar(sparameter$, 1)  
  if iTransType =  8, XFormMirror = 1
  if iTransType = 13, XFormRotate = 1
  if iTransType = 16, XFormTranslate = 1
 ]
pretract        #End of tool path, toolchange
    if not(iTransType = 16 & iTransMeth & op_id$ <> xform_op_id$), # Transform ToolPath
       [if enable_refapp = 0 & enable_refret = 0 & stoolplname = swcsplname, "G0 G90", pwcs , "X0."],  # CENTER TABLE OF PART
       
      !TransformToolPathCustomParameterIO  #Transformed ToolPaths
      if TransformToolPathCustomParameterIO = 1 & iTransType = 16 & iTransMeth & op_id$ <> xform_op_id$,
       [
        !TransformToolPathCustomParameterReals1
        !TransformToolPathCustomParameterReals2
        !TransformToolPathCustomParameterReals3
        !TransformToolPathCustomParameterReals4
        if TransformToolPathCustomParameterReals1 <> 0 | TransformToolPathCustomParameterReals2 <> 0 | TransformToolPathCustomParameterReals3 <> 0 | TransformToolPathCustomParameterReals4 <> 0, "G0 G90 G53",  
             if TransformToolPathCustomParameterReals1 <> 0, "X", *TransformToolPathCustomParameterReals1,
         if TransformToolPathCustomParameterReals2 <> 0, "Y", *TransformToolPathCustomParameterReals2,
         if TransformToolPathCustomParameterReals4 <> 0, "ROTATION", *TransformToolPathCustomParameterReals4
         if TransformToolPathCustomParameterReals3 <> 0, "Z", *TransformToolPathCustomParameterReals3,
         !TransformToolPathCustomParameterReals1
         !TransformToolPathCustomParameterReals2
         !TransformToolPathCustomParameterReals3
         !TransformToolPathCustomParameterReals4
       ]
      e$

           if prmcode$ = 15870, TransformToolPathCustomParameterIO = rpar(sparameter$, 1)
           if prmcode$ = 15774, TransformToolPathCustomParameterIntegers1 = rpar(sparameter$, 1)
           if prmcode$ = 15775, TransformToolPathCustomParameterIntegers2 = rpar(sparameter$, 1)
           if prmcode$ = 15776, TransformToolPathCustomParameterIntegers3 = rpar(sparameter$, 1)
           if prmcode$ = 15777, TransformToolPathCustomParameterIntegers4 = rpar(sparameter$, 1)
           
           if prmcode$ = 15778, TransformToolPathCustomParameterReals1 = rpar(sparameter$, 1)
           if prmcode$ = 15779, TransformToolPathCustomParameterReals2 = rpar(sparameter$, 1)
           if prmcode$ = 15780, TransformToolPathCustomParameterReals3 = rpar(sparameter$, 1)
           if prmcode$ = 15781, TransformToolPathCustomParameterReals4 = rpar(sparameter$, 1)
           
        

      if TransformToolPathCustomParameterIO = 1,
       [
        if TransformToolPathCustomParameterReals1 <> 0 | TransformToolPathCustomParameterReals2 <> 0 | TransformToolPathCustomParameterReals3 <> 0 | TransformToolPathCustomParameterReals4 <> 0, "G0 G90 G53",
        if TransformToolPathCustomParameterReals1 <> 0, "X", *TransformToolPathCustomParameterReals1,
        if TransformToolPathCustomParameterReals2 <> 0, "Y", *TransformToolPathCustomParameterReals2,
        if TransformToolPathCustomParameterReals4 <> 0, "ROTATION", *TransformToolPathCustomParameterReals4
        if TransformToolPathCustomParameterReals3 <> 0, "Z", *TransformToolPathCustomParameterReals3,
       ]
      e$
      pbld, no_spc$, "M30", no_spc$,   

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