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:

JCube

Verified Members
  • Posts

    7
  • Joined

  • Last visited

JCube's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. OK I moved comment$ from pheader$ to psof$ and that is probably good enough, but is there a way to separate 1005, 1007 comments from 1006, 1026 comments so that I can still have my origin information above my tool list and my manual entry as code comments down below? This is what I'm getting now: ( 212.50.08.025 ) ( B5008025.MIN ) (PROGRAMMED CENTERLINE OF TOOL) (FULL SIZE TOOLS HAVE -0- IN D RAD COMP) (BLOCK SKIP ON FOR OKUMA MX-45VAE) ( APR 16 2021 15:39 ) ( T1 1/4 SPOTDRILL 2.1 OOH DIA-.25 ) ( T2 NO. 8 DRILL 2.5 OOH DIA-.199 ) ( T3 1/2 SPOTDRILL 4.25 OOH DIA-.5 ) ( T4 41/64 DRILL 5.1 OOH DIA-.640625 ) ( T5 1/2 SPECIAL IMCO 65286 4.6 OOH DIA-.5 ) ( T6 M6 X 1.0 TAP 2.1 OOH DIA-.2398 ) ( Toolpath Group-2 ) ( X0 & Y0 CENTER OF THE PART ) ( Z0 TOP OF THE PART ) ( USE ER-32 HOLDERS ) ( FOR ALL TOOLS ) G0 G90 G15 H1 G30 P1 X-9. G0 G40 G80 G90 IF [VTLCN EQ 1] N1 T1 M6 N1 ( T-1 H-1 D-1 DIA-.25 - 1/4 SPOTDRILL 2.1 OOH ) G15 H01 G0 G90 X.4923 Y-.8526
  2. Hello Folks, It's been a while and now I have a new question that I can't find an answer for. I'm still using X9 and the MPOkuma post referenced above. I have one job where I need to go to a safe tool change location. It's not that hard really, I just added a second comment as code after my comment as comment for origin location. The thing I don't like is that both comments post out in between the header and the tool list. I know it's just a click and drag to fix this but it would be nice if the post would do it so I don't have to. I've tried everything I can think of to move the comments, but when I do get the comments to move they show up after the tool change which defeats the purpose. I can't seem to get the tool table to move at all. This is what I am getting: ( 212.50.08.025 ) ( B5008025.MIN ) (PROGRAMMED CENTERLINE OF TOOL) (FULL SIZE TOOLS HAVE -0- IN D RAD COMP) (BLOCK SKIP ON FOR OKUMA MX-45VAE) ( APR 15 2021 15:15 ) ( X0 & Y0 CENTER OF THE PART ) ( Z0 TOP OF THE PART ) ( USE ER-32 HOLDERS ) ( FOR ALL TOOLS ) G0 G90 G15 H1 G30 P1 X-9. ( T1 1/4 SPOTDRILL 2.1 OOH DIA-.25 ) ( T2 NO. 8 DRILL 2.5 OOH DIA-.199 ) ( T3 1/2 SPOTDRILL 4.25 OOH DIA-.5 ) ( T4 41/64 DRILL 5.1 OOH DIA-.640625 ) ( T5 1/2 SPECIAL IMCO 65286 4.6 OOH DIA-.5 ) ( T6 M6 X 1.0 TAP 2.1 OOH DIA-.2398 ) ( Toolpath Group-2 ) G0 G40 G80 G90 IF [VTLCN EQ 1] N1 T1 M6 N1 ( T-1 H-1 D-1 DIA-.25 - 1/4 SPOTDRILL 2.1 OOH ) G15 H01 G0 G90 X.4923 Y-.8526 And this is what I would like to get: ( 212.50.08.025 ) ( B5008025.MIN ) (PROGRAMMED CENTERLINE OF TOOL) (FULL SIZE TOOLS HAVE -0- IN D RAD COMP) (BLOCK SKIP ON FOR OKUMA MX-45VAE) ( APR 15 2021 15:15 ) ( X0 & Y0 CENTER OF THE PART ) ( Z0 TOP OF THE PART ) ( USE ER-32 HOLDERS ) ( FOR ALL TOOLS ) ( T1 1/4 SPOTDRILL 2.1 OOH DIA-.25 ) ( T2 NO. 8 DRILL 2.5 OOH DIA-.199 ) ( T3 1/2 SPOTDRILL 4.25 OOH DIA-.5 ) ( T4 41/64 DRILL 5.1 OOH DIA-.640625 ) ( T5 1/2 SPECIAL IMCO 65286 4.6 OOH DIA-.5 ) ( T6 M6 X 1.0 TAP 2.1 OOH DIA-.2398 ) ( Toolpath Group-2 ) G0 G90 G15 H1 G30 P1 X-9. G0 G40 G80 G90 IF [VTLCN EQ 1] N1 T1 M6 N1 ( T-1 H-1 D-1 DIA-.25 - 1/4 SPOTDRILL 2.1 OOH ) G15 H01 G0 G90 X.4923 Y-.8526 Any ideas? Thank you -Jeff
  3. Colin, you are my new hero I played with the While statement a little bit earlier and didn't terminate it properly. I ended up with over a million lines of ( RIGHT VISE H11 ). The file size was over 20MB LOL I'll use your first option since it seems to be the more straight forward of the 2. And now that I have a little better understanding of what is going on, it shouldn't be hard to make the same changes to my other 3 posts. I will also copy this thread to a file in my archives for future reference so I'll be able to do it again after I forget I'm not really a programmer, just a lowly machinist that also has to do programming. I would buy you a beer if you weren't all the way on the other side of the country (I'm in Washington state just south of Seattle) I thank you very much and wish you and yours all the best! Jeff
  4. Ok I almost got it by adding: string9 = rbuf(9, rc9) sopen_prn, string9, sclose_prn, e$ #Operation comment after ptoolcomment comment$ in about the middle of psof$, but it is only giving me the first line from the buffer file. The buffer file does have both lines in it still. And it is exactly where I want it now I just need to figure out how to make it give up the complete buffer file. -Jeff
  5. Thank you Colin Almost there. I had to add the parenthesis for the op comments later on in the program. The comment is no longer showing up in the wrong place in between the header and the tool table, but it's not showing up after the tool comment after the first tool change either. I've got 3 machines that are just about to finish up their jobs so I'll be busy setting up most of the rest of the day :/ Here is ( I think ) all of the relevant code so far: # -------------------------------------------------------------------------- # Buffer definitions # -------------------------------------------------------------------------- #Buffer 9, output strings for testing wc9 : 1 #Initial count for write buffer 9 rc9 : 1 #Initial count for read buffer 9 size9 : 0 #Buffer 9 size string9 : "" #Buffer 9 fbuf 9 1 255 0 1 #Buffer 9 # -------------------------------------------------------------------------- # Tool Comment / Manual Entry Section # -------------------------------------------------------------------------- ptoolcomment #Comment for tool tnote = t$ toffnote = tloffno$ tlngnote = tlngno$ "(", *tnote, *tlngnote, *toffnote, *tldia$," - ", pstrtool, ")", e$ if tool_info = 1 | tool_info = 3, "(", pstrtool, sdelimiter, *tnote, sdelimiter, *toffnote, sdelimiter, *tlngnote, ")", e$ ptooltable #Tooltable output 999 sopen_prn, *t$, pstrtool, *tldia$, sclose_prn, e$ # [if comp_type > 0 & comp_type < 4, sdelimiter, *tloffno$, sdelimiter, *scomp_type, sdelimiter, *tldia$], # [if xy_stock <> 0 | z_stock <> 0, sdelimiter, *xy_stock, sdelimiter, *z_stock], pstrtool #Comment for tool if strtool$ <> sblank, [ strtool$ = ucase(strtool$) *strtool$, " " ] pcomment$ #Comment from manual entry (must call pcomment2 if booleans) pcomment2,e$ pcomment2 #Comment from manual entry scomm$ = ucase (scomm$) if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$ #Manual entry - as comment if gcode$ = 1006, scomm$, e$ #Manual entry - as code if gcode$ = 1007, sopen_prn, scomm$, sclose_prn #Manual entry - as comment with move NO e$ if gcode$ = 1026, scomm$ #Manual entry - as code with move NO e$ # if gcode$ = 1008, sopen_prn, scomm$, sclose_prn, e$ #Operation comment if gcode$ = 1008, [ if header = 1, [ string9 = scomm$ string9 = wbuf (9, wc9) ] else, pbld, n$, sopen_prn, scomm$, sclose_prn, e$ ] if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$ #Machine name if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$ #Group comment if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$ #Group name if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$ #File Descriptor # else, scomm$, e$ # -------------------------------------------------------------------------- # Start of File and Toolchange Setup # -------------------------------------------------------------------------- header : 0 #Header flag variable for comment processing sop_comm : "" #String variable for saved operation comment ptime #Convert 24-hour time format into 12-hour AM/PM format if time$ >= 13, time2 = (time$ - 12) else, time2 = time$ hour = int(time2), min = frac(time2) *hour, ":", *min, if time$ > 12, " PM" else, " AM" pheader$ #Call before start of file header = one #"%", e$ sav_spc = spaces$ spaces$ = 0 #*progno$, sopen_prn, sspace, sprogname$, sspace, sclose_prn, e$ sopen_prn, sspace, sprogname$, sspace, sclose_prn, e$ #sopen_prn, sspace, "PROGRAM NAME - ", sprogname$, sspace, sclose_prn, e$ "(PROGRAMMED CENTERLINE OF TOOL)", e$ "(FULL SIZE TOOLS HAVE -0- IN D RAD COMP)", e$ "(BLOCK SKIP ON FOR OKUMA MX-45VAE)", e$ #sopen_prn, sspace, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sspace, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52 #sopen_prn, sspace, "DATE - ", month$, "-", day$, "-", year$, sspace, sclose_prn, e$ #Date output as month,day,year - Ex. 02-12-05 sopen_prn, sspace, *smonth, " ", day$, " ", *year2, sspace, time$, sspace, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005 #sopen_prn, sspace, "TIME - ", time$, sspace, sclose_prn, e$ #24 hour time output - Ex. 15:52 #sopen_prn, sspace, "TIME - ", ptime, sspace, sclose_prn, e$ #12 hour time output 3:52 PM #spathnc$ = ucase(spathnc$) #smcname$ = ucase(smcname$) #stck_matl$ = ucase(stck_matl$) snamenc$ = ucase(snamenc$) #sopen_prn, sspace, "MCX FILE - ", *smcpath$, *smcname$, *smcext$, sspace, sclose_prn, e$ #sopen_prn, sspace, "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, sspace, sclose_prn, e$ #sopen_prn, sspace, "MATERIAL - ", *stck_matl$, sspace, sclose_prn, e$ spaces$ = sav_spc comment$ header = zero psof0$ #Start of file for tool zero psof$ psof$ #Start of file for non-zero tool number pcuttype toolchng = one if ntools$ = one, [ #skip single tool outputs, stagetool must be on stagetool = m_one !next_tool$ ] pbld, n$, *sgcode, "G40", "G80", *sgabsinc, e$ sav_absinc = absinc$ #if stagetool >= zero, pbld, n, *t$, e$ spaces$=0 okuma_skip_toolnumber = t$ pbld, n$, "IF [VTLCN EQ ", *okuma_skip_toolnumber, "] ", *n$, e$ spaces$=sav_spc n$ = n$ - seqinc$ pbld, n$, *t$, "M6", e$ #pbld, n$, "M6", e$ #t_nt = t$ pbld, *n$, e$ #pbld, n$, *t$, "M6", e$ ptoolcomment comment$ if mi1$ <= one, #Work coordinate system [ absinc$ = one ##### pfbld, n, sgabsinc, *sg28ref, "Z0.", e ##### pfbld, n, *sg28ref, "X0.", "Y0.", e ##### pfbld, n, "G92", *xh, *yh, *zh, e absinc$ = sav_absinc ] else, pwcs,e$ #pbld, pwcs,e$ pcom_moveb c_mmlt$ #Multiple tool subprogram call pcan pindex if mi1$ > one, absinc$ = zero pcan1, pbld, n$, *sgcode, *sgabsinc, pfxout, pfyout, pfcout, e$ pbld, n$, *speed, *spindle, pgear, next_tool$, strcantext, e$ pbld, n$, "G56", *tlngno$, pfzout, scoolant, e$ absinc$ = sav_absinc pcom_movea toolchng = zero c_msng$ #Single tool subprogram call ptlchg0$ #Call from NCI null tool change (tool number repeats) And this is what's in the buffer file: LEFT VISE H1 RIGHT VISE H11 So it is getting into the buffer, just having a little trouble getting back out again. I tried a few things so far but mostly got "label not defined" errors. I'll try again later on after I get the machines running again. Thank you again, Jeff
  6. Back in '92 I had a guy explain a few things to me about editing a post on Cadkey 5 with Cutting Edge4. Everything since then has been trial and error. This one might just be above what I can do. I've spent all my "free" time the past couple of weeks trying to figure out string buffers and maybe it's just beyond me. All I have come up with is something like: # -------------------------------------------------------------------------- # Buffer definitions # -------------------------------------------------------------------------- #Buffer 9, output strings for testing wc9 : 1 #Initial count for write buffer 9 rc9 : 1 #Initial count for read buffer 9 size9 : 0 #Buffer 9 size string9 : "" #Buffer 9 fbuf 9 0 255 0 1 #Buffer 9 Maybe that will work to define a buffer (and maybe not) But how would I get gcode 1008 into it and how then would I pull that back out where I want it? Is it something like string9 = gcode 1008 and then pwritebuffer_9? I'm not trying to get you all to just give me an easy answer. I really have tried to figure this out. If you think this is just too advanced for me then let me know. Thanks, Jeff
  7. Hello guys, I hope I'm posting this in the right place. I've read a bunch of stuff here and I have my comments almost perfect for how I want them. However, my first Tool Comment (1008) is 2 lines in mastercam but only the second line is posted out. On tools other than the first, it works OK. I'm using X9 and a modified MPOkuma.pst This is what I get at the beginning of the program after the header: G0 G40 G80 G90 IF [VTLCN EQ 1] N1 T1 M6 N1 ( T-1 H-1 D-1 DIA-3. - 3" FACE MILL ) ( H11 RIGHT VISE ) G15 H01 G0 G90 X4.775 Y-.7875 S3500 M3 T2 G56 H1 Z2. And this is further down in the program: IF [VTLCN EQ 6] N6 T6 M6 N6 / T6 M6 (BLOCK SKIP ON FOR OKUMA MX) ( T-6 H-6 D-6 DIA-.25 - 1/4 CHAMFER MILL ) ( H6 LEFT VISE ) ( H16 RIGHT VISE ) G15 H01 The first section of code should have ( H1 LEFT LEFT VISE ) right above the ( H11 RIGHT VISE ) Here are the relevant sections from my post: # Start of File and Toolchange Setup # -------------------------------------------------------------------------- header : 0 #Header flag variable for comment processing sop_comm : "" #String variable for saved operation comment ptime #Convert 24-hour time format into 12-hour AM/PM format if time$ >= 13, time2 = (time$ - 12) else, time2 = time$ hour = int(time2), min = frac(time2) *hour, ":", *min, if time$ > 12, " PM" else, " AM" pheader$ #Call before start of file header = one #"%", e$ sav_spc = spaces$ spaces$ = 0 #*progno$, sopen_prn, sspace, sprogname$, sspace, sclose_prn, e$ sopen_prn, sspace, sprogname$, sspace, sclose_prn, e$ #sopen_prn, sspace, "PROGRAM NAME - ", sprogname$, sspace, sclose_prn, e$ "(PROGRAMMED CENTERLINE OF TOOL)", e$ "(FULL SIZE TOOLS HAVE -0- IN D RAD COMP)", e$ "(BLOCK SKIP ON FOR OKUMA MX-45VAE)", e$ #sopen_prn, sspace, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sspace, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52 #sopen_prn, sspace, "DATE - ", month$, "-", day$, "-", year$, sspace, sclose_prn, e$ #Date output as month,day,year - Ex. 02-12-05 sopen_prn, sspace, *smonth, " ", day$, " ", *year2, sspace, time$, sspace, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005 #sopen_prn, sspace, "TIME - ", time$, sspace, sclose_prn, e$ #24 hour time output - Ex. 15:52 #sopen_prn, sspace, "TIME - ", ptime, sspace, sclose_prn, e$ #12 hour time output 3:52 PM #spathnc$ = ucase(spathnc$) #smcname$ = ucase(smcname$) #stck_matl$ = ucase(stck_matl$) snamenc$ = ucase(snamenc$) #sopen_prn, sspace, "MCX FILE - ", *smcpath$, *smcname$, *smcext$, sspace, sclose_prn, e$ #sopen_prn, sspace, "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, sspace, sclose_prn, e$ #sopen_prn, sspace, "MATERIAL - ", *stck_matl$, sspace, sclose_prn, e$ spaces$ = sav_spc comment$ header = zero psof0$ #Start of file for tool zero psof$ psof$ #Start of file for non-zero tool number pcuttype toolchng = one if ntools$ = one, [ #skip single tool outputs, stagetool must be on stagetool = m_one !next_tool$ ] pbld, n$, *sgcode, "G40", "G80", *sgabsinc, e$ sav_absinc = absinc$ #if stagetool >= zero, pbld, n, *t$, e$ spaces$=0 okuma_skip_toolnumber = t$ pbld, n$, "IF [VTLCN EQ ", *okuma_skip_toolnumber, "] ", *n$, e$ spaces$=sav_spc n$ = n$ - seqinc$ pbld, n$, *t$, "M6", e$ #pbld, n$, "M6", e$ #t_nt = t$ pbld, *n$, e$ #pbld, n$, *t$, "M6", e$ ptoolcomment if sop_comm <> sblank, sopen_prn, sop_comm, sclose_prn, e$ #Output saved operation comment if mi1$ <= one, #Work coordinate system [ absinc$ = one ##### pfbld, n, sgabsinc, *sg28ref, "Z0.", e ##### pfbld, n, *sg28ref, "X0.", "Y0.", e ##### pfbld, n, "G92", *xh, *yh, *zh, e absinc$ = sav_absinc ] else, pwcs,e$ This is my first post, so I apologize for not getting the format correct. On our Okumas it is common to use different height offsets for different work offsets. I haven't been able to come up with a better way that the boss will accept. But I would like to be able to easily note the changes in the program as I did successfully with T6 in the above example. Any help at all would be greatly appreciated. Thank you Jeff

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