travisprimary
-
Posts
13 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
eMastercam Wiki
Blogs
Gallery
Events
Posts posted by travisprimary
-
-
I've had to add some logic and a postblock to increment my tool N numbers when the same tool is used at different times. The way we number sequences here is pretty simple: the first time a tool is called up it is simply N and the tool number, ie N3. The second time it is used it is N302, the N303 and so on.
This same method could probably be used to increment your sub program numbers, without the need to use a misc int or real.
If you're interested in the code let me know and I'll post it. Right now I'm supposed to be working
I would be interested in looking at that code to see if it would help me with my post.
Thank you.
-
To add to that might also think about a process to have it incremented. If you are calling the same tool through out the program in different places then you will get the same sub program call and not unique ones. I controlled this in the past with a mi or mr so I could detail it down to a very finite level.
I haven't used a mi or mr at all. How could I use to get the subs to increment?
Thank you.
-
So when I create a variable for custom drilling cycle can I use more than the ten different variables that the custom drill parameters has?
-
That did it.
Thank you very much for your help.
The only other thing I added was:
if drillcyc$ = 9,
[
refht_z = refht$
drl_prm1 = drl_prm1$
drl_prm2 = drl_prm2$
drl_prm3 = drl_prm3$
pdrlcommonb
pcan1, pdrlxy, e$ <---------------------------------------added this line so it will move to next hole location
pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$
pbld, n$, pfzout, *feed, e$
pbld, n$, *refht_z, *drl_prm3, e$
pcom_movea
]
Thanks again.
-
I've been working on a custom drill cycle for my post and I've almost got it but I can't get it to input the feed with the value I have given it in my custom drill parameters.
I can get a post of this:
T21 M06 (.385 GO DRILL KENNAMETAL# 4149277)
M11 (UNLOCK)
G90 G80 G49 G40 G17 G00 G54 B0. X0. Y.818 S2650 M03
M10 (LOCK)
G43 H21 Z8.3 M88
(DRILL PISTON BORE)
G94
G01 Z0. F0. <---------- custom line
Z7. F25. <---------- custom line
Z8.3 F0. <---------- custom line
M89
G91 G28 Z0. M05
With this in my post:
pdrlcst$ #Custom drill cycles 8 - 19 (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
#if drillcyc = 8, pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
# prdrlout, dwell, *feed, strcantext, e$
if drillcyc$ = 8,
[
sub_prg_call = peck1$
pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
pbld, n$, "M98", *sub_prg_call, e$
]
if drillcyc$ = 9,
[
refht_z = refht$
pdrlcommonb
pcan1, pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$
pbld, n$, pfzout, *feed, e$
pbld, n$, *refht_z, *drl_prm3, e$
pcom_movea
]
else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$
pcom_movea
pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
#if drillcyc = 8, pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell,
# feed, strcantext, e$
if drillcyc$ = 8,
[
sub_prg_call = peck1$
pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
pbld, n$, "M98", *sub_prg_call, e$
]
if drillcyc$ = 9,
[
refht_z = refht$
pdrlcommonb
pcan1, pbld, n$, *sg01, *drl_prm1, *drl_prm2, e$
pbld, n$, pfzout, *feed, e$
pbld, n$, *refht_z, *drl_prm3, e$
pcom_movea
]
else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$
pcom_movea
Or I can get this:
T21 M06 (.385 GO DRILL KENNAMETAL# 4149277)
M11 (UNLOCK)
G90 G80 G49 G40 G17 G00 G54 B0. X0. Y.818 S2650 M03
M10 (LOCK)
G43 H21 Z8.3 M88
(DRILL PISTON BORE)
G94
G01 drl_prm1$ 8. drl_prm2$ 10.
Z7. F25.
Z8.3 drl_prm3$ 60.
M89
G91 G28 Z0. M05
With this in my post:
pdrlcst$ #Custom drill cycles 8 - 19 (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
#if drillcyc = 8, pcan1, pbld, n$, *sgdrlref, *sgdrill, pdrlxy, pfzout, pcout, pindexdrl,
# prdrlout, dwell, *feed, strcantext, e$
if drillcyc$ = 8,
[
sub_prg_call = peck1$
pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
pbld, n$, "M98", *sub_prg_call, e$
]
if drillcyc$ = 9,
[
refht_z = refht$
pdrlcommonb
pcan1, pbld, n$, *sg01, *drl_prm1$, *drl_prm2$, e$
pbld, n$, pfzout, *feed, e$
pbld, n$, *refht_z, *drl_prm3$, e$
pcom_movea
]
else, "CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, pfcout, pindexdrl, e$
pcom_movea
pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
#if drillcyc = 8, pcan1, pbld, n$, pdrlxy, pzout, pcout, pindexdrl, prdrlout, dwell,
# feed, strcantext, e$
if drillcyc$ = 8,
[
sub_prg_call = peck1$
pcan1, pbld, n$, *sg00, *sgabsinc, pfxout, pfyout, pfcout, pindexdrl, strcantext, e$
pbld, n$, "M98", *sub_prg_call, e$
]
if drillcyc$ = 9,
[
refht_z = refht$
pdrlcommonb
pcan1, pbld, n$, *sg01, *drl_prm1$, *drl_prm2$, e$
pbld, n$, pfzout, *feed, e$
pbld, n$, *refht_z, *drl_prm3$, e$
pcom_movea
I have my custom drill parameters set as follows:
# --------------------------------------------------------------------------
# Custom drilling cycle 9, carbide drill drilling cycle
# --------------------------------------------------------------------------
fmt "Z" 2 drl_prm1 #starting Z depth
fmt "F" 2 drl_prm2 #starting feed rate
fmt "F" 2 drl_prm3 #retract feed rate
fmt "Z" 2 refht_z #for Z retract height output
# --------------------------------------------------------------------------
Seems like I can get it to either post the F or Z code I have assigned or post the numbers I have for my custom parameters in Mastercam.
What am I doing wrong??
-
Colin G. - Eapprentice.net, on 03 July 2014 - 10:05 PM, said:
This will set the subprogram number, equal to the tool number, times one hundred.
sub_prg_no$ = t$ * 100
Depending on the calling order of the post blocks, you may also need to add that line of code in the 'psub_st_s$' post block as well.
I've tried putting this in the psub_call_s$ and psub_st_s$.
I still can't get it to work.
This is what I have in my post now:
psub_call_s$ #Call to sub level
result = nwadrs(strp, sub_prg_no$)
sub_prg_no$ = t$ * 100 #Add sub number offset
if progno$ = sub_prg_no$, result = mprint(sprgnerror)
pbld, n$, "M97", *sub_prg_no$, e$
psub_st_s$ #Header in sub leveln
result = nwadrs(strn, sub_prg_no$)
sub_prg_no$ = t$ * 100
if first_sub & subs_before, first_sub = zero #suppress blank line before first sub with subs before main
else, " ", e$
*sub_prg_no$, e$
pbld, n$, sgabsinc, e$
psub_end_s$ #End in sub level
n$, "M99", e$
prv_absinc$ = -1
-
I'm trying to get my post to change my sub number to the tool number times 100 and I can't get the sub number to change to at all.
What I I'm getting is this:
( ROUGH PROFILE )
T1 M6 ( .375 ROUGHER E.M. )
G0 G90 G54 X-.145 Y.3445 S12000 M3
G43 H1 Z.1 M8 T2
M97 P0001
( ROUGH PROFILE )
G90 G55 X-.145 Y.3445 Z.1
M97 P0001
M9
G91 G28 Z0. M5
M01
( FACE TOP )
T2 M6 ( .375 E.M. )
G0 G90 G54 X.7455 Y-1.385 S12000 M3
G43 H2 Z.1 M8 T3
M97 P0002
( FACE TOP )
G90 G55 X.7455 Y-1.385 Z.1
M97 P0002
M9
G91 G28 Z0. M5
M01
And what I want is this:
( ROUGH PROFILE )
T1 M6 ( .375 ROUGHER E.M. )
G0 G90 G54 X-.145 Y.3445 S12000 M3
G43 H1 Z.1 M8 T2
M97 P100
( ROUGH PROFILE )
G90 G55 X-.145 Y.3445 Z.1
M97 P100
M9
G91 G28 Z0. M5
M01
( FACE TOP )
T2 M6 ( .375 E.M. )
G0 G90 G54 X.7455 Y-1.385 S12000 M3
G43 H2 Z.1 M8 T3
M97 P200
( FACE TOP )
G90 G55 X.7455 Y-1.385 Z.1
M97 P200
M9
G91 G28 Z0. M5
M01
I've been trying to change stuff in the post here:
psub_call_s$ #Call to sub level
result = nwadrs(strp, sub_prg_no$)
sub_prg_no$ = sub_prg_no$ + 1000 #Add sub number offset <------------------- I tried several different ways of doing the "=" on this line but I can't get it to change at all.
if progno$ = sub_prg_no$, result = mprint(sprgnerror)
pbld, n$, "M97", *sub_prg_no$, e$
I'm not even sure if I'm trying in the right place or not.
I'd also like it to give me the program number + 1 for each sub for a different post. I'm guessing the change between the two would be pretty similar.
Thank you very much.
-
Ok that works like I want it to.
Thank you again for your help.
-
So I tried the *pwcs and still didn't get a work offset code. I tried the *g_wcs and it works like I want it to but only for G54-G59, it puts in a G0 in place of a G154.xx.
Thank you for helping me out.
-
I'm having trouble editing my post to give me a work offset call with a G90 A0. at the end of my program.
This is where I am trying to put it in my post:
peof$ #End of file for non-zero tool
pretract
comment$
if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$
n$, *sgcode, *sgabsinc, pwcs, "A0.", e$ <------- the line I have added.
n$, "M30", e$
Not sure what I'm doing wrong to get a output of G54, G55, etc.
This is what it is posting:
G0 Z1.1
M9
G91 G28 Z0. M5
G28 Y0.
G0 G90 A0.
M30
%
And this is what I want:
G0 Z1.1
M9
G91 G28 Z0. M5
G28 Y0.
G0 G90 G54(or whatever work offset program is using) A0.
M30
%
Thank you
-
I'm not sure about the mi or mr trigger. I couldn't find it in the post.
I did block out the sav_rot_on_x=0 line and everything seems good now.
Thank you very much for the help.
-
On my Mori post I don't get any lock or unlock codes (M10 and M11) as well as no B. move, (which would be B0.). I get these codes when I have rotations programmed but I still want/need the code when doing just doing work on B0.
How can I get these codes to come up without B axis rotation?
Custom drill cycle problems
in Post Processor Development Forum
Posted
I guess the part that was confusing me was I thought if it wasn't named drl_prm1 etc, then the post would not know where to look in Mastercam to get the custom drill parameters input while programming. Where I was going with the only having ten variables was if drl_prm1 was for a "Z" value then any other custom parameters I would use the parameter 1 in mastercam would always have to be a "Z" value, but I guess that is not the case if you can create your own variables?