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:

Posting question


Greg_J
 Share

Recommended Posts

When I post a program that cuts arc's it gives me a XYZIJ in every line is there a way to take out redundant info. I don't need the Z in a line that's not moving in the Z or a I0, J0 either.

 

I need to shrink the size of my program.

 

Thanks for the help.

 

Greg

Link to comment
Share on other sites

Can you put up this part of the post:

 

code:

plinout         #Output to NC of linear movement - feed  

pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, `feed, strcantext, scoolant, e$

 

pcirout #Output to NC of circular interpolation

if not(arccomp), pcompwarn

if fmtrnd(xabs) = prv_xabs & fmtrnd(yabs) = prv_yabs & fmtrnd(zabs) = prv_zabs, result = force(xabs,zabs) #force coordinate on full arc

if hel_2100 = one, pcirout2

else, pcirout1

 

pcirout1 #Output to NC of circular interpolation

pcan1, pbld, n$, `sgfeed, sgplane, sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, parc, feed, strcantext, scoolant, e$

 

pcirout2 #Output to NC of circular interpolation

if (plane$ = zero & fmtrnd(zinc)<>0)

| (plane$ = one & fmtrnd(xinc)<>0)

| (plane$ = two & fmtrnd(yinc)<>0), phelout

else, pcirout1

 

phelout #Output to NC of helical interpolation

if plane$ = zero,

[

result = nwadrs(strk, lead)

lead = abs(zinc/sweep$*360)

]

if plane$ = one,

[

result = nwadrs(stri, lead)

lead = abs(xinc/sweep$*360)

]

if plane$ = two,

[

result = nwadrs(strj, lead)

lead = abs(yinc/sweep$*360)

]

pcan1, pbld, n$, `sgfeed, sgplane, sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, *lead, pcout, parc, feed, strcantext, scoolant, e$

 

 

parc #Select the arc output

if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane

(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane

(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane

[

result = newfs(two, iout)

result = newfs(two, jout)

result = newfs(two, kout)

]

else,

[

result = newfs(three, iout)

result = newfs(three, jout)

result = newfs(three, kout)

]

#if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |

# (plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,

if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |

(plane$ = 2 & arctypexz$ < five) | full_arc_flg$,

[

#Arc output for IJK

# If you do NOT want to force out the I,J,K values,

# remove the "*" asterisks on the *i, *j, *k 's below...

if plane$ = zero, *iout, *jout, kout #XY plane code - G17

if plane$ = one, iout, *jout, *kout #YZ plane code - G19

if plane$ = two, *iout, jout, *kout #XZ plane code - G18

!i$, !j$, !k$

]

else,

[

#Arc output for R

if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 & arctypeyz$ = five) |

(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)

else, result = nwadrs(srminus, arcrad$)

*arcrad$

]

Then someone can help you get it straightened out.

Link to comment
Share on other sites

I hope this is it, it's not the exact same as the one you posted.

 

 

code:

 

plinout #Output to NC of linear movement - feed

pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, `feed, strcantext, scoolant, e$

 

pcirout #Output to NC of circular interpolation

if hel_2100 = one, pcirout2

else, pcirout1

 

pcirout1 #Output to NC of circular interpolation

pcan1, pbld, n$, `sgfeed, sgplane, *sgcode, sgabsinc, pccdia,

pfxout, pfyout, pfzout, pcout, parc, feed, strcantext, scoolant, e$

 

pcirout2 #Output to NC of circular interpolation

if (plane$ = zero & abs(zinc)>=0.0005)

| (plane$ = one & abs(xinc)>=0.0005)

| (plane$ = two & abs(yinc)>=0.0005), phelout

else, pcirout1

 

phelout #Output to NC of helical interpolation

lead = abs(zinc/sweep$*360)

if plane$ = zero, result = nwadrs(strk, lead)

if plane$ = one, result = nwadrs(stri, lead)

if plane$ = two, result = nwadrs(strj, lead)

pcan1, pbld, n$, `sgfeed, sgplane, sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, *lead, pcout, parc, feed, strcantext, scoolant, e$

 

pcom_moveb #Common motion preparation routines, before

pxyzcout

ps_inc_calc

 

pncoutput #Movement output

pcom_moveb

comment$

if coolant$ <> 0 & coolant$ <> sav_coolant,

[

pbld, n$, sm09, e$

sav_coolant = coolant$

]

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if cool_zmove = yes$ & (nextop$=1003 | (nextop$=1011 & t$<>abs(nexttool))), coolant$ = zero

pcan

if cuttype = zero, ppos_cax_lin #Toolplane rotary positioning

if gcode$ = zero, prapidout

if gcode$ = one, plinout

if gcode$ > one & gcode$ < four, pcirout

if mr_rt_actv, #Restore absolute/incremental for G51/G68

[

absinc$ = sav_absinc

mr_rt_actv = zero

]

pcom_movea

 

pcom_movea #Common motion preparation routines, after

pcan2

pe_inc_calc

 

pdwl_spd$ #Call from NCI gcode 4

pspindle

comment$

pspindchng

pcan

if fmtrnd(dwell$), pcan1, pbld, n$, *sgcode, *dwell$, strcantext, e$

else, pcan1, pbld, n$, strcantext, e$

pcan2

 

prapid$ #Output to NC of linear movement - rapid

pncoutput

 

pzrapid$ #Output to NC of linear movement - rapid Z only

pncoutput

 

plin$ #Output to NC of linear movement - feed

pncoutput

 

pz$ #Output to NC of linear movement - feed Z only

pncoutput

 

pmx$ #Output to NC of vector NCI

pncoutput

 

pcir$ #Output to NC of circular interpolation

pncoutput

 

#Pre-process rotary motion control flags

pmx0$ #5 axis gcode setup

if drillcur$ = zero,

[

if fr$ = -2,gcode$ = zero

else, gcode$ = one

]

 

plin0$ #Linear movement, mill motion test

pmotion_su

 

pcir0$ #Circular interpolation, mill arc motion test

pmotion_su

 

# --------------------------------------------------------------------------

# Motion output components

# --------------------------------------------------------------------------

pbld #Canned text - block delete

if bld, '/'

 

pfbld #Force - block delete

"/"

 

pccdia #Cutter Compensation

#Force Dxx#

if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k

sccomp

if cc_pos$, tloffno$

 

pfxout #Force X axis output

if absinc$ = zero, *xabs, !xinc

else, *xinc, !xabs

 

pxout #X output

if absinc$ = zero, xabs, !xinc

else, xinc, !xabs

 

pfyout #Force Y axis output

if absinc$ = zero, *yabs, !yinc

else, *yinc, !yabs

 

pyout #Y output

if absinc$ = zero, yabs, !yinc

else, yinc, !yabs

 

pfzout #Force Z axis output

if absinc$ = zero, *zabs, !zinc

else, *zinc, !zabs

 

pzout #Z output

if absinc$ = zero, zabs, !zinc

else, zinc, !zabs

 

pfcout #Force C axis output

if index = zero & rot_on_x,

[

if absinc$ = zero, *cabs, !cinc

else, *cinc, !cabs

]

 

pcout #C axis output

if index = zero & rot_on_x,

[

if absinc$ = zero, cabs, !cinc

else, cinc, !cabs

]

 

pindex #Index output

if index & rot_on_x,

[

if fmtrnd(prv_indx_out) <> fmtrnd(indx_out),

[

if lock_codes = 1 & rotretflg = 0, pbld, n$, *sunlock, "(UNLOCK)", e$

pbld, n$, `sindx_mc, indx_out, e$

if lock_codes = 1 & cuttype = 0 & rotretflg = 0, pbld, n$, *slock, "(LOCK)", e$

]

!cabs, !cinc

]

 

parc #Select the arc output

if arcoutput$ = zero | full_arc_flg$ | arc_pitch$,

[

#Arc output for IJK

# If you do NOT want to force out the I,J,K values,

# remove the "*" asterisks on the *i, *j, *k 's below...

if plane$ = zero, *i$, *j$, k$ #XY plane code - G17

if plane$ = one, i$, *j$, *k$ #YZ plane code - G19

if plane$ = two, *i$, j$, *k$ #XZ plane code - G18

]

else,

[

#Arc output for R

if abs(sweep$)<=180 | arcoutput$=one, result = nwadrs(srad, arcrad$)

else, result = nwadrs(srminus, arcrad$)

*arcrad$

]

Link to comment
Share on other sites

code:

parc            #Select the arc output

if arcoutput$ = zero | full_arc_flg$ | arc_pitch$,

[

#Arc output for IJK

# If you do NOT want to force out the I,J,K values,

# remove the "*" asterisks on the *i, *j, *k 's below...

if plane$ = zero, *i$, *j$, k$ #XY plane code - G17

if plane$ = one, i$, *j$, *k$ #YZ plane code - G19

if plane$ = two, *i$, j$, *k$ #XZ plane code - G18

]

else,

[

#Arc output for R

if abs(sweep$)<=180 | arcoutput$=one, result = nwadrs(srad, arcrad$)

else, result = nwadrs(srminus, arcrad$)

*arcrad$

]

This section controls IJK so if you take out the * if will take care of that.

Link to comment
Share on other sites

code:

pcirout1        #Output to NC of circular interpolation

pcan1, pbld, n$, `sgfeed, sgplane, *sgcode, sgabsinc, pccdia,

pfxout, pfyout, pfzout, pcout, parc, feed, strcantext, scoolant, e$

The pfxout, pfyout, and the pfzout force out X,Y,Z every time there is a Arc move. So if you change it to pxout, pyout, and pzout you will get them only, but make sure your machine can handle this change.

 

HTH

 

[ 08-07-2009, 10:13 PM: Message edited by: Crazy^Millman ]

Link to comment
Share on other sites

Is this the area that your talking about? It has "`sgcode" what does ` mean?

 

 

code:

 # --------------------------------------------------------------------------

# Motion NC output

# --------------------------------------------------------------------------

#The variables for absolute output are xabs, yabs, zabs.

#The variables for incremental output are xinc, yinc, zinc.

# --------------------------------------------------------------------------

prapidout #Output to NC of linear movement - rapid

pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, strcantext, scoolant, e$

# pbld, n, "M01 (CHECK INSERT)", e

 

plinout #Output to NC of linear movement - feed

pcan1, pbld, n$, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, pcout, `feed, strcantext, scoolant, e$

 

pcirout #Output to NC of circular interpolation

if hel_2100 = one, pcirout2

else, pcirout1

 

pcirout1 #Output to NC of circular interpolation

pcan1, pbld, n$, `sgfeed, sgplane, *sgcode, sgabsinc, pccdia,

pfxout, pfyout, pfzout, pcout, parc, feed, strcantext, scoolant, e$

 

pcirout2 #Output to NC of circular interpolation

if (plane$ = zero & abs(zinc)>=0.0005)

| (plane$ = one & abs(xinc)>=0.0005)

| (plane$ = two & abs(yinc)>=0.0005), phelout

else, pcirout1

 

phelout #Output to NC of helical interpolation

lead = abs(zinc/sweep$*360)

if plane$ = zero, result = nwadrs(strk, lead)

if plane$ = one, result = nwadrs(stri, lead)

if plane$ = two, result = nwadrs(strj, lead)

pcan1, pbld, n$, `sgfeed, sgplane, sgcode, sgabsinc, pccdia,

pxout, pyout, pzout, *lead, pcout, parc, feed, strcantext, scoolant, e$

 

pcom_moveb #Common motion preparation routines, before

pxyzcout

ps_inc_calc

Link to comment
Share on other sites

The " ` " means it is forced with a condition, it will come out only if something else on the line has to be outputed otherwise it won't come out.

As for the "*sgcode" you found in the pcircout1 block this one is only for the arc moves. You probably have one also into plinout, prapidout, and maybe a few other places.

 

HTH

Link to comment
Share on other sites

How many places would you guess would have the *?

 

I'm nervous to change them because I've noticed it has some for the G28 G91 Z0 line and a few others that I need the 0 to be there. I guess I just need to be careful the ones I change and test my post after I change each one.

Link to comment
Share on other sites

Sorry not getting back to this topic sooner but you answered your question:

 

quote:

I'm nervous to change them because I've noticed it has some for the G28 G91 Z0 line and a few others that I need the 0 to be there. I guess I just need to be careful the ones I change and test my post after I change each one.

This is how I have approached many changes to posts over the years. You are on the right path and asking very good questions soon you will be surprised how much you can do with posts.

 

HTH

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