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:

Removing DATE, NC FILE, MATERIAL from header in program


Roger
 Share

Recommended Posts

I would like to know how to stop posting this information at the top of my programs.  Also I would like the tool list to appear at the top of the program, and at the corresponding tool change in the program.  And if possible the tools NOT TO SHOW the diameters.

Today I've been trying to get the posted code more to my liking, and the people on here have already been VERY HELPFULL!  Thanks everyone!! :)

Untitled.jpg

Link to comment
Share on other sites

From the Generic posts look here:

pheader$         #Call before start of file
      if subs_before, " ", e$ #header character is output from peof when subs are output before main
      else, "%", e$
      sav_spc = spaces$
      spaces$ = 0
      *progno$, sopen_prn, sprogname$, sclose_prn, e$
      #sopen_prn, "PROGRAM NAME - ", sprogname$, sclose_prn, e$
      sopen_prn, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
      #sopen_prn, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
      #sopen_prn, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
      #sopen_prn, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
      #sopen_prn, "TIME - ", ptime 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, "MCX FILE - ", *smcpath$, *smcname$, *smcext$, sclose_prn, e$
      sopen_prn, "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, sclose_prn, e$
      sopen_prn, "MATERIAL - ", *stck_matl$, sclose_prn, e$
      spaces$ = sav_spc
#endregion

The # sign means do not post htis. On the tool list information per tool then you have add that to the psof$ and ptlchng$ and each of those you will see this line

      pbld, n$, *t$, sm06, e$

Need to take what is in the ptooltable you want and add it correctly to the line above in both places.

ptooltable      #Tooltable output
      sopen_prn, *t$, sdelimiter, pstrtool, sdelimiter, *tlngno$,
        [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],
        sclose_prn, e$
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

In that same area to remove the output of the tool diameter you erase tldia$. How do we know what is what is outputting that? We look here:

fmt "TOOL - "      4   tnote    #Note format
fmt "DIA. OFF. - " 4   toffnote #Note format
fmt "LEN. - "      4   tlngnote #Note format
fmt "TOOL DIA. - " 1   tldia$   #Note format
fmt "XY STOCK TO LEAVE - " 2  xy_stock #Note format
fmt "Z STOCK TO LEAVE - "  2  z_stock  #Note format

HTH

  • Like 2
Link to comment
Share on other sites

Depending on which Post you started with, there is possibly a Switch variable, "tool_info", which controls the output of Tool Table, and Tool Comments. If you have the switch in your Post, try using a value of '3'. That should give you both outputs.

1=Tool Table only

2=Tool Comments at each Tool Change

3=Both sets of Comments being output

 

  • Thanks 1
Link to comment
Share on other sites
21 hours ago, C^Millman said:

The # sign means do not post htis. On the tool list information per tool then you have add that to the psof$ and ptlchng$ and each of those you will see this line

Millman, I thought I would start with getting the header information removed 1st.  So I put the # in front of these two lines.  THAT WORKED on removing the material, and date.  But didn't work when I tried it with the NC File, or the MCX file.  It would generate the program name in parentheses 3 times. :blink:

5b5238f685f22_Untitled3.thumb.jpg.eeb4de8f4cd0b8f8d9fa491dec90979e.jpg

 

333.jpg.27059b70b38c5f8c1a7825582b0e9b48.jpg

Link to comment
Share on other sites
15 hours ago, Colin Gilchrist said:

Depending on which Post you started with, there is possibly a Switch variable, "tool_info", which controls the output of Tool Table, and Tool Comments. If you have the switch in your Post, try using a value of '3'. That should give you both outputs.

1=Tool Table only

2=Tool Comments at each Tool Change

3=Both sets of Comments being output

 

Changing this to 3 WORKED GREAT!!  Thanks Colin!!!

  • Like 2
Link to comment
Share on other sites

Glad that worked for what you wanted Roger.

Ron: Roger is using the Generic Haas 4X Mill Post (or 3X Mill Post), from CNC Software.

Roger, I happen to be the guy that did a bunch of work to that Post when I was still working at CNC. The reason you aren't getting the "File Name and Path" comments fixed, is because you aren't adding "enough" pound signs. (There are a couple "uncommented" lines that are still outputting information!)

We did something a little different with the Generic Haas Posts "Comment output". The Haas Control has a "character limit" per line, of 80 characters.

So I devised a common Post Block, called "pcomment_out", which is the line that actually "outputs" the comment. Prior to that output call, on the line above, we set the variable 'scomm_fx_arg'. This variable is a "common" string variable, that we "set", before we call 'pcomment_out'.

The 'pcomment_out' Post Block, take the 'scomm_fx_arg' string as "input", and measures the String Length. Then it adds the "string length" of the Comment Start and Comment End Characters to the String. Finally, it tests the output, and if the string is greater than you "Max Comment Length", the String is either "truncated", or "shortened", to fit within the character limit.

Ok, that was a whole bunch of explanation, just to get to this:

Put a Pound Sign (#) in front of the two 'pcomment_out' lines. That will stop the file comments from Posting.

Link to comment
Share on other sites
16 minutes ago, Colin Gilchrist said:

Glad that worked for what you wanted Roger.

Ron: Roger is using the Generic Haas 4X Mill Post (or 3X Mill Post), from CNC Software.

Roger, I happen to be the guy that did a bunch of work to that Post when I was still working at CNC. The reason you aren't getting the "File Name and Path" comments fixed, is because you aren't adding "enough" pound signs. (There are a couple "uncommented" lines that are still outputting information!)

We did something a little different with the Generic Haas Posts "Comment output". The Haas Control has a "character limit" per line, of 80 characters.

So I devised a common Post Block, called "pcomment_out", which is the line that actually "outputs" the comment. Prior to that output call, on the line above, we set the variable 'scomm_fx_arg'. This variable is a "common" string variable, that we "set", before we call 'pcomment_out'.

The 'pcomment_out' Post Block, take the 'scomm_fx_arg' string as "input", and measures the String Length. Then it adds the "string length" of the Comment Start and Comment End Characters to the String. Finally, it tests the output, and if the string is greater than you "Max Comment Length", the String is either "truncated", or "shortened", to fit within the character limit.

Ok, that was a whole bunch of explanation, just to get to this:

Put a Pound Sign (#) in front of the two 'pcomment_out' lines. That will stop the file comments from Posting.

THAT WORKED GREAT!!!!!!!!!!!  THANK YOU AGAIN!  There is only 1 more thing that I descried above that I need explained so my simple mind can understand.  How to remove the tool diameter from the tool call out line.

Link to comment
Share on other sites
24 minutes ago, Roger said:

How to remove the tool diameter from the tool call out line.

I'm not positive, because I don't have a seat of MC to check it available right this minute. But I believe that if you place a # after (2, tlngnote) you will get the result you want. Make a backup 1st :)

Then change this:

ptoolcomment    #Comment for tool
      tnote = t$, toffnote = tloffno$, tlngnote = tlngno$
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = strtool$ + sdelimiter + drs_str(2, tnote) + sdelimiter +
          drs_str(2, toffnote) + sdelimiter + drs_str(2, tlngnote) + sdelimiter + drs_str(2, tldia$)
        pcomment_out #Check comment length and output to NC file
        ]

 

to this:

ptoolcomment    #Comment for tool
      tnote = t$, toffnote = tloffno$, tlngnote = tlngno$
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = strtool$ + sdelimiter + drs_str(2, tnote) + sdelimiter +
          drs_str(2, toffnote) + sdelimiter + drs_str(2, tlngnote)# + sdelimiter + drs_str(2, tldia$)
        pcomment_out #Check comment length and output to NC file
        ]
Link to comment
Share on other sites
18 minutes ago, So not a Guru said:

I'm not positive, because I don't have a seat of MC to check it available right this minute. But I believe that if you place a # after (2, tlngnote) you will get the result you want. Make a backup 1st :)

Then change this:


ptoolcomment    #Comment for tool
      tnote = t$, toffnote = tloffno$, tlngnote = tlngno$
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = strtool$ + sdelimiter + drs_str(2, tnote) + sdelimiter +
          drs_str(2, toffnote) + sdelimiter + drs_str(2, tlngnote) + sdelimiter + drs_str(2, tldia$)
        pcomment_out #Check comment length and output to NC file
        ]

 

to this:


ptoolcomment    #Comment for tool
      tnote = t$, toffnote = tloffno$, tlngnote = tlngno$
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = strtool$ + sdelimiter + drs_str(2, tnote) + sdelimiter +
          drs_str(2, toffnote) + sdelimiter + drs_str(2, tlngnote)# + sdelimiter + drs_str(2, tldia$)
        pcomment_out #Check comment length and output to NC file
        ]

That removed it from the individual tool call outs,  I would like to get rid of all this circled in red output also.  Leaving ONLY the tool description H and D numbers. 

Untitled.jpg.45aa6ebc78f51482e1608cc00b968175.jpg

Link to comment
Share on other sites
5 minutes ago, Roger said:

That removed it from the individual tool call outs,  I would like to get rid of all this circled in red output also.  Leaving ONLY the tool description H and D numbers.

Ok, do the same thing in the ptooltable post block, except the # should be after the (2, tloffno$).

Change this:

ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$) + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

To this:

ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$)# + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values
Link to comment
Share on other sites
9 minutes ago, So not a Guru said:

Ok, do the same thing in the ptooltable post block, except the # should be after the (2, tloffno$).

Change this:


ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$) + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

To this:


ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$)# + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

That worked for the tool diameters!  I just want what is shown at the top of this screen shot to also post at each tool change.  (Remove circled info)

Untitled.jpg.2cc2bc02d7649fdc61875f1c9f114366.jpg

Link to comment
Share on other sites

Ok, move the # to the line above, after strtool$.

So this line changes from this:

scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +

To this:

scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$# + sdelimiter + drs_str(2, tlngno$) + sdelimiter +

I don't think it is necessary, but you may also have to put a # in front of the line that follows. Like this:

  #drs_str(2, tloffno$) + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm

 

Link to comment
Share on other sites
On ‎7‎/‎20‎/‎2018 at 3:51 PM, So not a Guru said:

Ok, move the # to the line above, after strtool$.

So this line changes from this:


scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +

To this:


scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$# + sdelimiter + drs_str(2, tlngno$) + sdelimiter +

I don't think it is necessary, but you may also have to put a # in front of the line that follows. Like this:


  #drs_str(2, tloffno$) + sdelimiter + drs_str(2, tldia$) + sccomp_comm + sstock_left_comm

 

Below is what I want it to look like.

 

5b5784756956e_Untitled2.jpg.51795db717a142e385af8f1559bd1fca.jpg

 

This is how it is posting now.

5b5781f633492_Untitled2.jpg.d259eea3f40ddd423784af426285beaa.jpg

Link to comment
Share on other sites

Hi Roger,

Try this:

ptoolcomment    #Comment for tool
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = strtool$ + sdelimiter + drs_str(2, tnote) + sdelimiter +
          drs_str(2, tloffno$) + sdelimiter + drs_str(2, tlngno$)
        pcomment_out #Check comment length and output to NC file
        ]
        
ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$)
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

 

Link to comment
Share on other sites

Ok, sorry, I didn't see that you just wanted the same configuration as the Tool Table. This should do it:

ptoolcomment    #Comment for tool
      if tool_info = 1 | tool_info = 3,
        [
        pstrtool #Convert strtool$ to uppercase if string is not empty
        scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
          drs_str(2, tloffno$)
        pcomment_out #Check comment length and output to NC file
        ]
        
ptooltable      #Tooltable output
      pstrtool #check strtool and force uppercase
      #Check comp_type, set sccomp_comm
      if comp_type > 0 & comp_type < 4, sccomp_comm = sdelimiter + slout(comp_type, scomp)
      else, sccomp_comm = sblank
      #Check xy_stock and z_stock, set sstock_left_comm
      if xy_stock <> 0 | z_stock <> 0, sstock_left_comm = sdelimiter + drs_str(2, xy_stock) + sdelimiter + drs_str(2, z_stock)
      else, sstock_left_comm = sblank
      #Build string for comment length check
      scomm_fx_arg = drs_str(2, t$) + sdelimiter + strtool$ + sdelimiter + drs_str(2, tlngno$) + sdelimiter +
        drs_str(2, tloffno$)
      pcomment_out #Check comment length and output to NC file
      xy_stock = 0  #Reset stock to leave values
      z_stock = 0   #Reset stock to leave values

 

  • Like 1
Link to comment
Share on other sites
43 minutes ago, Colin Gilchrist said:

Ok, sorry, I didn't see that you just wanted the same configuration as the Tool Table. This should do it:

THAT WORKED!!  :thumbup: :thumbup: You sir need not say sorry!  YOU HAVE DID ME A GREAT BIG FAVOR!!  If your ever in this area (Vancouver, WA / Portland OR), I would love to take you to lunch!!! :D

Link to comment
Share on other sites
6 minutes ago, Roger said:

THAT WORKED!!  :thumbup: :thumbup: You sir need not say sorry!  YOU HAVE DID ME A GREAT BIG FAVOR!!  If your ever in this area (Vancouver, WA / Portland OR), I would love to take you to lunch!!! :D

Anytime Roger.

I was actually looking to move to the Portland area with my wife. I got a decent job offer, and a few places showed interest, but I got a better offer in the Tacoma area. So looks like that's where we are headed.

I'm sure I'll be making it down to Portland at some point, so I might just take you up on that beer offer. I mean lunch. But I also assumed that included beer. Lol

I guess it will also depend on if it is a workday. Lunch without beer is cool too.

Link to comment
Share on other sites
8 minutes ago, Colin Gilchrist said:

I'm sure I'll be making it down to Portland at some point, so I might just take you up on that beer offer. I mean lunch. But I also assumed that included beer. Lol

I guess it will also depend on if it is a workday. Lunch without beer is cool too.

The reason I said lunch is, I don't drink.  The only alcohol I've ever had, was a glass of champagne, back when I was like 22, my older brother had won a trophy dash race and we where celebrating his win.

Congratulations on the new job, I had read your post on moving to the Portland area.  Tacoma is about 130 miles from here, so I look forward to meeting you, and including buying you lunch, and a beer.  ;)

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