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:

Post Processor comments to header


Recommended Posts

Hello, 

I am using an older version of mastercam X3 from 2007. I use an assortment of older machines so every post I've had to edit to make it work, however, I am having some trouble getting my edits to do what I want this time and after looking everywhere and spending several hours trial error all I have is error.. 

What I want to do is move some of the comments around. I want to remove the properties - " " from the operation manager from showing up before a tool change to save memory. I want to move it to the header area under "program number", "created on", and above "material". I have tried an assortment of ways but nothing works so far. How would I go about this? 

The reason I want it moved above is because I'm not always the one running the machine so we always check the program for which machine it's supposed to be used on so we don't crash. The issue is that I have to manually add this line in ever single time and it's a little tedious OR I  completely forget... 

For the life of me I can't figure out what to do because any time i move the line comment$ and pcan it removes all the checked (from machine file check boxes) to my comment area but leaves them on consecutive tools ... 

If anyone can help that would be great. 

Link to comment
Share on other sites

Thanks for the reply Craig, 

I attached my header code with a jpeg of what I'm looking for. Basically I want to take machine name and group comment and move it to the header and remove it from above every tool. I'm just playing around with some formatting and set up sheets to make it easier for operators as we do a lot of custom work, small runs and lots of revision changes. We also have a lot of different machines too. So for me to manually edit where the datum is in the program or enter the wrong machine means someone has a problem.

NC mastercam adjust.JPG

mastercam pheader.txt

mastercam pcomment.txt

Link to comment
Share on other sites

Try the following adjustments

sav_commentfilter : 0 # variable to save the commentfilter

pheader$         #Call before start of file                         
      if wcs_mode <> two, # Yes, read 'mi1' to set 'wcs_mode'
        [
        if mi1$ = zero | mi1$ = one,  # Get Work Coordinate System mode setting
          wcs_mode = mi1$   # 'G92' output modes w/ 'G28' retracts
        else, wcs_mode = two   # 'E' fixture offset mode
        ]
      else, wcs_mode = two # 'E' fixture offset mode
      "%", e$
      n$, *progno$, "(", sprogname$,")", e$
      sav_spc = spaces$
      spaces$ = 0
      #*progno$, sopen_prn, sprogname$, sclose_prn, e$
      n$, sopen_prn, sspace, "CREATED ON - ", day$, "-", month$, "-", year$, " AT - ", ptime, sspace, sclose_prn, e$
      #n$, sopen_prn, sspace, "PROGRAM NAME - ", sprogname$, sclose_prn, e$
      #n$, sopen_prn, sspace, "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, sclose_prn, e$ #Date and time output Ex. 12-02-05 15:52
      #n$, sopen_prn, sspace, "DATE - ", month$, "-", day$, "-", year$, sclose_prn, e$  #Date output as month,day,year - Ex. 02-12-05
      #n$, sopen_prn, sspace, "DATE - ", *smonth, " ", day$, " ", *year2, sclose_prn, e$ #Date output as month,day,year - Ex. Feb. 12 2005
      #n$, sopen_prn, sspace, "TIME - ", time$, sclose_prn, e$  #24 hour time output - Ex. 15:52
      #n$, sopen_prn, sspace, "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$)
	  
	  #********************************** Added lines*****************
	  sav_commentfilter = comm_filter$ 	# save comm_filter
	  comm_filter$ =1110011111			# set comment filter
	  comment$ 							# add comments
	  comm_filter$ = sav_commentfilter 	# restore comment filter
	  #********************************** End of change **************
	  
      #n$, sopen_prn, sspace, "MCX FILE - ", *smcpath$, *smcname$, *smcext$, sspace, sclose_prn, e$
      #n$, sopen_prn, sspace, "NC FILE - ", *spathnc$, *snamenc$, *sextnc$,sspace, sclose_prn, e$
      n$, sopen_prn, sspace, "MATERIAL - ", *stck_matl$, sspace, sclose_prn, e$
      spaces$ = sav_spc


pcomment2       #Output Comment from manual entry
      scomm$ = ucase (scomm$)
      if gcode$ = 1005, n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #Manual entry - as comment
      if gcode$ = 1006, n$, 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$ = 1053,
	    [
		n$, *e$
		n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #Group name
		n$, *e$
		]
      if gcode$ = 1008, n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #Operation comment
      #if gcode$ = 1051, n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #Machine name
      #if gcode$ = 1052, n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #Group comment
      if gcode$ = 1054, n$, no_spc$, sopen_prn, scomm$, sclose_prn, e$  #File Descriptor

Greetz Jan

  • Like 2
Link to comment
Share on other sites
  • 2 weeks later...

Perfect, thanks @Werktuigbouwer for the input. I will give it a try and see what happens. We have been swamped with work and I'm the only programmer/operator/IT but this gives some ideas of where to look. I was trying to juggle a few of the comments around but it kept giving me everything but what I wanted. haha. BTW I think my formatting was off and that is why I couldn't get it to work the way I wanted... So thanks for the input!

@Grimes HAHA I change my material LOL 😳

 

Link to comment
Share on other sites
  • 3 weeks later...

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

×   Your link has been automatically embedded.   Display as a link instead

 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

×