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:

small subprogram prob


Recommended Posts

hi all ,havent been around much lately.

i have a spotdrill that performs several different operations(spots,chamfers).

when i post using subs it will it will do all of the chamfering on all of the parts then go back and do all of the spotting.this gets even longer when i handle my chamfers in different ways(it will do each one and then move to the next part,and produces lots of wasted motion.i would like to perform everything that the spotdrill is programmed to do before moving to the next part.

is there a way of somehow grouping all of the operations performed by this tool before the translate?

Link to comment
Share on other sites

im also trying this post to see if it will work for me but havent found any documentation on how to use it..

 

 

this was taken directly off the mc post site.

 

"

Mastercam V8 or V9 in combination with a newer V8 or V9 post has imbedded subprogram support for depth cuts, and toolpath transformations.

 

This post is however specifically used to efficiently program multiple identical parts using subprograms and incrementing Work Coordinate System values (G54, G55, G56, etc.). Click here to view sample output.

 

Program a part once, and specify the number of required repetitions under Misc Values."

 

 

im using the post they say to use but im not getting the subs to output at all.

i assume you dont use transform at all with this.i tried selecting all the ops and editing common params misc values to a number greater than one.

anyone else using this?

Link to comment
Share on other sites

Sorry that was either or not both. One will posting and transform using operation and the other will go tools in the order used if used for more than one operation. The group by operation will do operation 1,2,3 then next offset 1,2,3 where as by operatino type if usign the same tool it will do operation 1 then next work offset operation 1, then operation 2 then ............

 

I hope that makes sense.

Link to comment
Share on other sites

Ok what post are you using? What version of Mastercam are you using? and what machine are you posting this too. If you have sample code of what you want put it up. If you have what you are getting and can make it short and sweet put it up. These will all helps us to help you. I do this all the time and have 4 parts running right now that will run till Tuesday and 4 different fixture offset and no probelm so has to be the post.

 

Have you contacted your dealer to see what they say?

 

If you have a sample file of what you are doing that would also help.

 

headscratch.gifheadscratch.gif is where I am without some more of the above information.

Link to comment
Share on other sites

thanks millman

like i said earlier im just fooling around with this today because ive got some free time.

 

mc ver 9 service pack 2

im using the mpsubrep post from the mc site

and im posting at the moment for a haas vf3

 

my dealer is prism eng and no one is there this weekend.

if the speed drops for one of the last ops in the sub,it never picks up again because it never calls the original speed again.

here is a small segment of the posted code.

 

 

T2 M06 ( 1/2 FLAT ENDMILL)

 

 

(MAX | Z2.) (i dont want these 2 lines )

(MIN | Z-.585) (either)

 

 

G00 G90 G54 X-.209 Y-2.6825 S7500 M03

G43 H2 Z2. M08

M97 P0002

 

G00 G90 G55 X-.209 Y-2.6825 (needs speed again)

 

M98 P0002

M05

G91 G28 Z0. M09

M01

Link to comment
Share on other sites

here is a complete short prog.you can see the speed drops at the end of the last sub but it never picks up when it goes to the next sub.

 

 

%

O0524

(PROGRAM NAME - KAWASAKI ZX6 2003 SHIFTSIDE OP2.NC)

(DATE - APR-15-98 TIME - 19:41)

(T1 | 1/2 FLAT ENDMILL | H1 | D1 | D0.5000" | | CONTOUR....)

(T2 | 1/2 FLAT ENDMILL | H2 | D2 | D0.5000" | | CONTOUR....)

(T3 | 1/4 CHAMFER MILL | H3 | D3 | D0.2500" | | CONTOUR....)

(OVERALL MAX | Z2.)

(OVERALL MIN | Z-.585)

G00 G40 G49 G80 G90

T1 M06 ( 1/2 FLAT ENDMILL)

(MAX | Z2.)

(MIN | Z-.4)

G00 G90 G54 X-.3542 Y-2.7276 S6500 M03

G43 H1 Z2. M08

M97 P0001

G00 G90 G55 X-.3542 Y-2.7276

M98 P0001

M05

G91 G28 Z0. M09

M01

 

T2 M06 ( 1/2 FLAT ENDMILL)

(MAX | Z2.)

(MIN | Z-.585)

G00 G90 G54 X-.209 Y-2.6825 S7500 M03

G43 H2 Z2. M08

M97 P0002

G00 G90 G55 X-.209 Y-2.6825

M98 P0002

M05

G91 G28 Z0. M09

M01

 

T3 M06 ( 1/4 CHAMFER MILL)

(MAX | Z2.)

(MIN | Z-.11)

G00 G90 G54 X-.0389 Y-2.8175 S7250 M03

G43 H3 Z2. M08

M97 P0003

G00 G90 G55 X-.0389 Y-2.8175

M98 P0003

M05

G91 G28 Z0.

G90

M30

 

 

O0001

( 1/2 FLAT ENDMILL - CONTOUR)

G00 G90 X-.3542 Y-2.7276

Z2.

Z.1

G01 Z-.4 F65.

G41 D1 X-.0741 Y-2.6203

G03 X-.0694 Y-2.618 I-.0107 J.028

G01 X.6878 Y-2.1639

X1.4449 Y-1.7098

G02 X1.8418 Y-1.7642 I.1646 J-.2744

X1.8733 Y-1.8048 I-.1887 J-.1788

G01 X1.903 Y-1.8521

X2.3929 Y-1.8108

X4.9514 Y-.298

G03 X4.9582 Y-.2893 I-.0076 J.0129

G02 X5.5402 Y-1.2192 I.7057 J-.2055

G03 X5.5294 Y-1.2215 I-.0025 J-.0148

G01 X3.7479 Y-2.402

G03 X3.8706 Y-2.8419 I.1326 J-.2001

G01 X6.1378 Y-2.9351

G03 X6.1483 Y-2.9314 I.0006 J.015

G02 X6.1324 Y-4.0277 I.4816 J-.5553

G03 X6.1221 Y-4.0238 I-.0102 J-.011

G01 X1.5248 Y-4.069

G03 X1.516 Y-4.0719 I.0001 J-.015

G02 X.1855 Y-3.3306 I-.4985 J.6698

G03 X.1823 Y-3.32 I-.0149 J.0013

X-.0547 Y-3.1236 I-.5803 J-.4592

G02 X-.0694 Y-2.618 I.1345 J.2569

G03 X-.0651 Y-2.6149 I-.0154 J.0257

G40 G01 X-.0198 Y-2.5756

G00 Z2.

M99

 

 

O0002

( 1/2 FLAT ENDMILL - CONTOUR)

G00 G90 X-.209 Y-2.6825

Z2.

Z.1

G01 Z-.585 F50.

G41 D2 X-.0689 Y-2.6289

G03 X-.0642 Y-2.6266 I-.0107 J.028

G01 X.6929 Y-2.1725

X1.4501 Y-1.7184

G02 X1.8345 Y-1.771 I.1594 J-.2659

X1.8648 Y-1.8101 I-.1815 J-.172

G01 X1.8977 Y-1.8626

X2.396 Y-1.8206

X4.9565 Y-.3066

G03 X4.9678 Y-.2921 I-.0127 J.0215

G02 X5.5419 Y-1.2094 I.6961 J-.2027

G03 X5.5239 Y-1.2132 I-.0042 J-.0246

G01 X3.7424 Y-2.3937

G03 X3.8702 Y-2.8519 I.1381 J-.2084

G01 X6.1374 Y-2.9451

G03 X6.1548 Y-2.939 I.001 J.025

G02 X6.1391 Y-4.0204 I.475 J-.5477

G03 X6.122 Y-4.0138 I-.0169 J-.0184

G01 X1.5247 Y-4.059

G03 X1.51 Y-4.0639 I.0002 J-.025

G02 X.1955 Y-3.3314 I-.4926 J.6618

G03 X.1902 Y-3.3138 I-.0249 J.0021

X-.0501 Y-3.1148 I-.5881 J-.4654

G02 X-.0642 Y-2.6266 I.1299 J.2481

G01 X-.0557 Y-2.6214

G03 X-.0514 Y-2.6184 I-.0154 J.0257

G40 G01 X-.0061 Y-2.579

G00 Z2.

M99

 

 

O0003

( 1/4 CHAMFER MILL - CONTOUR)

G00 G90 X-.0389 Y-2.8175

Z2.

Z.1

G01 Z-.06 F30.

G41 D3 X.0311 Y-2.7907

G03 X.0335 Y-2.7895 I-.0054 J.014

G01 X.7906 Y-2.3354

X1.5478 Y-1.8814

G02 X1.6966 Y-1.9017 I.0617 J-.1029

X1.7039 Y-1.9111 I-.0436 J-.0413

G01 X1.7441 Y-1.9752

G03 X1.9131 Y-2.0519 I.1531 J.1125

G01 X2.4553 Y-2.0063

X5.0532 Y-.4701

G03 X5.1502 Y-.3452 I-.1094 J.1851

G02 X5.5739 Y-1.0221 I.5137 J-.1496

G03 X5.4189 Y-1.0548 I-.0362 J-.2119

G01 X3.6374 Y-2.2353

G03 X3.8624 Y-3.0417 I.2431 J-.3668

G01 X6.1296 Y-3.1349

G03 X6.2793 Y-3.0825 I.0088 J.2148

G02 X6.2677 Y-3.8805 I.3505 J-.4042

G03 X6.1201 Y-3.8238 I-.1455 J-.1583

G01 X1.5228 Y-3.869

G03 X1.3966 Y-3.9115 I.0021 J-.215

G02 X.3848 Y-3.3477 I-.3791 J.5094

G03 X.3392 Y-3.1959 I-.2142 J.0184

X.038 Y-2.9464 I-.7371 J-.5833

G02 X.0335 Y-2.7895 I.0417 J.0797

G01 X.0421 Y-2.7844

G03 X.0442 Y-2.7828 I-.0077 J.0129

G40 G01 X.0668 Y-2.7632

G00 Z.25

X2.0752 Y-2.8308

Z.1

G01 Z-.06 F30.

G41 D3 X2.005 Y-2.8574

G03 X2.0027 Y-2.8585 I.0053 J-.014

G01 X1.8174 Y-2.9685

G03 X1.7852 Y-3.07 I.0408 J-.0688

G02 X1.8514 Y-3.307 I-.7623 J-.3408

G03 X1.9317 Y-3.377 I.0794 J.01

G01 X3.1296 Y-3.363

G03 X3.1883 Y-3.2296 I-.0009 J.08

G02 X2.9639 Y-2.4415 I.6962 J.6241

G03 X2.8443 Y-2.3587 I-.0788 J.014

G01 X2.0027 Y-2.8585

X1.9941 Y-2.8636

G03 X1.9919 Y-2.8651 I.0077 J-.0129

G40 G01 X1.9692 Y-2.8847

G00 Z2.

X.4574 Y-2.8188

S6500

M09

Z.1

G99 G81 Z-.11 R.1 F12.

X1.4849 Y-2.1989

G80

G00 Z.1

G00 Z2.

M99

%

Link to comment
Share on other sites

this is a prog we are used to running(hand edited)note the 1st move is contained inside of the sub.

 

%

o0530

(HAYABUSA S OP2.NC)

(HYABUSA SHIFTSIDE OP#2)

(3pcs ON FIXTURES)

 

(TOOL= 1, 0.500 dia. End Mill RGH )

(TOOL= 2, 0.500 dia. End Mill FIN)

(TOOL= 3, 0.250 dia. SPOTDRILL )

 

G00 G90 G80 G40 G17 G49

T1 M06

(---0.500 DIA. END MILL---)

(RGH OD +.01)

M01

S6500 M03

G54 M97 P1000

/ G55 M97 P1000

/ G56 M97 P1000

/ G57 M97 P1000

/ G58 M97 P1000

/ G59 M97 P1000

M09

 

G00 Z6.

G54 X16.

G00 G91 G28 Z0 Y0

T2 M06

 

M00 (REMOVE CHUNKS)

 

G00 G90 G80 G40 G17 G49

G49 T2 M06

(---0.500 DIA. END MILL---)

(FIN OD+POCKET)

M01

S6500 M03

G54 M97 P2000

/ G55 M97 P2000

/ G56 M97 P2000

/ G57 M97 P2000

/ G58 M97 P2000

/ G59 M97 P2000

M09

 

G49 T3 M06

(---0.250 DIA. SPOTDRILL---)

(CHAMFERALL)

M01

S7500 M03

G54 M97 P3000

/ G55 M97 P3000

/ G56 M97 P3000

/ G57 M97 P3000

/ G58 M97 P3000

/ G59 M97 P3000

M09

 

G00 Z6.

G54 X16.

G00 G91 G28 Z0 Y0 M05

G49

T1 M06

M30

 

N1000

(---0.500 DIA. END MILL---)

(RGH OD +.01)

G00 X1.7071 Y0.3174

M08

G43 H01 Z1.

Z0.05

G01 Z-0.59 F65.

G41 D01 X1.7211 Y0.259

G03 X1.7436 Y0.2281 I0.0486 J0.0117

G01 X2.2314 Y-0.0707

G03 X2.2474 Y-0.0705 I0.0078 J0.0128

G01 X2.3326 Y-0.015

G02 X3.5328 Y-1.0392 I0.4492 J-0.689

G03 X4.4753 Y-2.2031 I0.7671 J-0.3424

G02 X4.0776 Y-3.601 I0.1718 J-0.8044

G03 X2.9748 Y-3.2801 I-0.8585 J-0.8948

G02 X2.4813 Y-3.2266 I-0.1621 J0.8064

G03 X1.2956 Y-3.5321 I-0.3988 J-0.9061

G02 X0.4076 Y-2.2446 I-0.6538 J0.499

G03 X0.8408 Y-1.9 I-0.2107 J0.7094

X0.8357 Y-1.8799 I-0.0131 J0.0074

X0.6062 Y-1.7861 I-0.3907 J-0.6285

G02 X0.4608 Y-1.3016 I0.0632 J0.283

G01 X1.6874 Y-0.0314

G02 X2.0847 Y0.0192 I0.2302 J-0.2223

G03 X2.1225 Y0.0132 I0.0261 J0.0426

G01 X2.1808 Y0.0272

G00 Z1.

G40 X2.1808 Y0.0272

M99

 

N2000

(---0.500 DIA. END MILL---)

(FIN OD+POCKET)

G90 G00 X1.8724 Y0.2044

M08

G43 H02 Z1.

Z0.05

G01 Z-0.58 F50.

G41 D02 X1.8864 Y0.1461

G03 X1.9089 Y0.1151 I0.0486 J0.0117

G01 X2.2262 Y-0.0792

G03 X2.2529 Y-0.0789 I0.0131 J0.0213

G01 X2.338 Y-0.0234

G02 X3.5237 Y-1.0352 I0.4437 J-0.6806

G03 X4.4774 Y-2.2129 I0.7762 J-0.3464

G02 X4.0846 Y-3.5938 I0.1697 J-0.7946

G03 X2.9728 Y-3.2703 I-0.8654 J-0.902

G02 X2.4854 Y-3.2174 I-0.1601 J0.7966

G03 X1.2876 Y-3.526 I-0.4028 J-0.9153

G02 X0.4104 Y-2.2542 I-0.6459 J0.4929

G03 X0.8495 Y-1.9049 I-0.2135 J0.719

X0.8409 Y-1.8714 I-0.0218 J0.0123

X0.6084 Y-1.7763 I-0.396 J-0.637

G02 X0.468 Y-1.3086 I0.061 J0.2733

G01 X1.6946 Y-0.0384

G02 X2.0795 Y0.0106 I0.223 J-0.2153

G03 X2.1173 Y0.0046 I0.0261 J0.0426

G01 X2.1756 Y0.0187

G00 Z1.

G40 X2.1756 Y0.0187

X1.9053 Y-1.096

Z0.05

G01 Z-0.58

G41 D02 X1.8195 Y-1.1475 F35.

G03 X1.7991 Y-1.1638 I0.0515 J-0.0857

G01 X1.523 Y-1.4497

G03 X1.5226 Y-1.4534 I0.0022 J-0.0021

G02 X1.5681 Y-2.2497 I-0.6949 J-0.4392

G03 X1.5716 Y-2.2539 I0.0027 J-0.0013

G02 X2.054 Y-2.1859 I0.511 J-1.8788

G03 X2.0568 Y-2.184 I0. J0.003

G02 X2.353 Y-1.8074 I0.7559 J-0.2898

G03 X2.3456 Y-1.386 I-0.1437 J0.2083

G02 X2.0108 Y-0.9509 I0.4361 J0.682

G03 X2.0058 Y-0.9497 I-0.0029 J-0.0009

G01 X1.7297 Y-1.2357

G03 X1.7141 Y-1.2567 I0.0719 J-0.0695

G01 X1.6656 Y-1.3441

G00 Z1.

G40 X1.6656 Y-1.3441

M99

 

N3000

(---0.250 DIA. SPOTDRILL---)

(CHAMFERALL)

G90 G00 X1.8975 Y-0.1048

M08

G43 H03 Z1.

Z0.05

G01 Z-0.08 F50.

G41 D03 X1.9451 Y-0.1413

G03 X1.9494 Y-0.1442 I0.0304 J0.0397

G01 X2.1217 Y-0.2498

G03 X2.3621 Y-0.2464 I0.1175 J0.1919

G01 X2.4472 Y-0.1909

G02 X3.3411 Y-0.9536 I0.3345 J-0.5131

G03 X4.5192 Y-2.4085 I0.9588 J-0.428

G02 X4.223 Y-3.4494 I0.1279 J-0.599

G03 X2.9334 Y-3.0742 I-1.0038 J-1.0463

G02 X2.5659 Y-3.0343 I-0.1207 J0.6005

G03 X1.1286 Y-3.4046 I-0.4834 J-1.0983

G02 X0.4674 Y-2.4459 I-0.4869 J0.3716

G03 X1.0235 Y-2.0035 I-0.2704 J0.9107

X0.9465 Y-1.7015 I-0.1958 J0.1109

X0.6519 Y-1.5811 I-0.5016 J-0.8068

G02 X0.6118 Y-1.4475 I0.0174 J0.0781

G01 X1.8384 Y-0.1773

G02 X1.975 Y-0.1599 I0.0791 J-0.0764

G01 X2.0006 Y-0.1756

G03 X2.0052 Y-0.1781 I0.0261 J0.0426

G01 X2.0594 Y-0.2039

G00 Z1.

G40 X2.0594 Y-0.2039

X1.6933 Y-0.9992

Z0.05

G01 Z-0.08

G41 D03 X1.6473 Y-1.0377

G03 X1.6435 Y-1.0413 I0.0321 J-0.0383

G01 X1.3812 Y-1.3129

G03 X1.3561 Y-1.5587 I0.1439 J-0.1389

G02 X1.3907 Y-2.1641 I-0.5283 J-0.3339

G03 X1.6233 Y-2.444 I0.1801 J-0.0869

G02 X2.0569 Y-2.3829 I0.4593 J-1.6887

G03 X2.2407 Y-2.2545 I-0.0029 J0.2

G02 X2.4649 Y-1.9695 I0.5719 J-0.2192

G03 X2.4518 Y-1.22 I-0.2555 J0.3704

G02 X2.1984 Y-0.8908 I0.33 J0.516

G03 X1.8641 Y-0.8129 I-0.1905 J-0.061

G01 X1.6018 Y-1.0845

G03 X1.5984 Y-1.0884 I0.036 J-0.0347

G01 X1.5615 Y-1.1357

G00 Z1.

G40 X1.5615 Y-1.1357

G98 G82 X1.0193 Y-1.3566 Z-0.11 R0.05 P0.2

X1.8529 Y-0.4934

G80

G00 Z1.

M99

 

%

Link to comment
Share on other sites

Well I never use this post but look here in the post:

code:

ptlchg0    # Null tool change

toolcount = toolcount + 1 #Index!

prvtp = rbuf(3,toolcountp) #Index!

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool

 

if tlplnno <> prvtp, n, pinc, "G28", "Z0."

if tlplnno <> prvtp, pindex #Index!

 

if opcode = three, ptlchg0drl

 

#if opcode <> three & mi1<>prv_mi1, xabs = nextx

#if opcode <> three & mi1<>prv_mi1, yabs = nexty

#if opcode <> three & mi1<>prv_mi1, zabs = zr

#if opcode <> three & mi1<>prv_mi1 & z <> zabs, n, *sg00, *zabs, e

#if opcode <> three & mi1<>prv_mi1, n, *sg00, pabs, pwcs, *xabs, *yabs, e

 

spaces=0

comment

spaces=spaces_sav

 

if op_id<>last_op_id, pstock #Stock!

 

n, speed

n, smcool

if tplnout = one, ptplane

last_op_id = op_id

At the n, speed line change it to n, *speed, *spdlon and see if that takes care of your speed coming out in the subs but may come out more than you want so if it does you will need to create a condition staement to see that it has been called and not to call it again. As far as the structure you are going to need ot email Dave and see what he can do for you there. They are nice enough to share and I think it only fair to give tme soemthing back if you need that much of a change. Sorry I can not be of more help.

Link to comment
Share on other sites

how can i get aal of my extended offsetts?i have g54-g59 then g110-g129.

my output will only go to g114 then resorts back to g92.sample below

 

G00 G90 G112 X-.3542 Y-2.7276

M98 P0001

G00 G90 G113 X-.3542 Y-2.7276

M98 P0001

G00 G90 G114 X-.3542 Y-2.7276

M98 P0001

G00 G90 G92 X-.3542 Y-2.7276

M98 P0001

G00 G90 G92 X-.3542 Y-2.7276

 

 

ive modified the post to this.

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

# Work coordinate system

sg50 G92 # Work coordinate system G code

sg51 G92 # " " " " "

sg52 G92 # " " " " "

sg53 G92 # " " " " "

sg54 G54 # " " " " "

sg55 G55 # " " " " "

sg56 G56 # " " " " "

sg57 G57 # " " " " "

sg58 G58 # " " " " "

sg59 G59 # " " " " "

sg60 G110 # " " " " "

sg61 G111 # " " " " "

sg62 G112 # " " " " "

sg63 G113 # " " " " "

sg64 G114 # " " " " "

sg65 G115 # " " " " "

sg66 G116 # " " " " "

sg67 G117 # " " " " "

sg68 G118 # " " " " "

sg69 G119 # " " " " "

sg70 G120 # " " " " "

sg71 G121 # " " " " "

sg72 G122 # " " " " "

sg73 G123 # " " " " "

sg74 G124 # " " " " "

sg75 G125 # " " " " "

sg76 G126 # " " " " "

sg77 G127 # " " " " "

sg78 G128 # " " " " "

sg79 G129 # " " " " "

Link to comment
Share on other sites

thanks everyone,especially crazzzzzzzzy millmam.ive got every issue resolved by myself and your help.(im not really very confident working inside posts)i wanted to try it on my own anyway.

the only issue now is getting the speed to come back up after it drops at the end of the sub.i can call my resller fo that.

 

thanks again for all the help!

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