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:

Sequence number output


Recommended Posts

I have sequence numbers turned off in my CD. But I want them to be output, matching the MC operation numbers, at my tool changes.

I can get the operation numbers to output at the tool changes, using this line in my psof & ptlchg sections:

      pbld, n$, *sopen_prn, no_spc$, *op_num, *sclose_prn, e$

That outputs: "(whatever the operation number is)". But What I want is "Nwhatever the operation number is"

Anyone know of a simple way to force the sequence number output?

  • Like 1
Link to comment
Share on other sites

What I'm looking for is: If the MC operation number in the toolpath manager is 13, the codefile would output N13 before the toolchange cantext, if the operation number is 48, it would output N48.

We already output the operation notes & numbers on our setup sheets, this makes restarts a cinch for the operators.

All of the rest of our posts have this functionality built in, we purchased them from Postability. But this is an old post that came from Onsrud & there is no support for it. I've got it outputting a lot of what we want, but this has been trying to whoop me.

Link to comment
Share on other sites

If the op_num  variable already exists you can use that....

 

find the tool change line

 

pbld, n$, t$, m6, e$  it should look something like that, quite possibly in 2 places

 

before it set

 

n$=op_num

 

then place the asterisk on the N

 

pbld, *n$, t$, m6, e$

 

It should be that simple

 

n$=op_num

pbld, *n$, t$, m6, e$

 

 

and as you're obviously a green post guy, I would make sure yo have a backed up good copy just in case

Link to comment
Share on other sites

 

This works even more elegantly in the tool comment section

ptoolcomment    #Comment for tool      n$," ",e$      n$=op_num      pbld, *n$,sopen_prn, pstrtool, sclose_prn, e$      sopen_prn, "TOOL# -", *t$, sdelimiter, *tldia$, sclose_prn, e$

 

Just don't forget that for the code above to work, you've got to initialize 'op_num', and then go get the parameter value:

pparameter$

      if prmcode$ = 15240, op_num = rpar(sparameter$, 1)
Link to comment
Share on other sites

 

Just don't forget that for the code above to work, you've got to initialize 'op_num', and then go get the parameter value:

pparameter$

      if prmcode$ = 15240, op_num = rpar(sparameter$, 1)

I already got that from the literature. :book:

Thanks again for the course :unworthy::respect:  . I am loving the h*ll out of learning & implementing this. Each day I don't learn something new seems like a wasted day, although I do spend an awful lot of time chasing my tail. :pc: 

Ok, I'm backing away from the emoticon window.

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

Is there a way to output sequence numbers on a given number of lines? So instead of outputting them on every line, it will put a sequence number on every 5th, or 10th, or  20th line.

 

Here is some code, but it is untested. Currently it still reads "on/off" from the Control Definition. I just replaced the "n$" output parameter with a call to a custom post block. Inside the post block I implemented some logic that checks to see if the current value of the counter equals the "output" value, and when it does, it forced out the Sequence Number. When the values don't match, then the logic simply increments the counter.

 

Keep in mind that you don't need to copy/past the 'prapidout', 'plinout', and 'pcirout' post blocks. Just remove the "n$" and replace it with "pncount". Then add the "pncount" post block, and the two variables.

 

Here is just the new code (not including "mods" to existing post blocks):

nout : 5 #Output every <nout> number of NC Lines
ccnt : 5 #Current Count (Initialize to same value as <nout>, to output on first motion block)

pncount         #Block to count and output sequence number, skipping lines
      if omitseq$ = zero, #Only output if enabled in CD
	    [
	    if ccnt = nout,
	      [
	      seqinc$ = nout #Set increment to equal output count (makes better sense to have them match)
	      *n$ #Force Sequence Number out
	      ccnt = one #Reset counter variable
              ]
            else, ccnt = ccnt + one #Increment counter
	    ]

Here is what the whole thing should look like:

nout : 5 #Output every <nout> number of NC Lines
ccnt : 1 #Current Count (Initialize to same value as <nout>, to output on first motion block)

pncount         #Block to count and output sequence number, skipping lines
      if omitseq$ = zero, #Only output if enabled in CD
        [
	if ccnt = nout,
	  [
	  seqinc$ = nout #Set increment to equal output count (makes better sense to have them match)
	  *n$ #Force Sequence Number out
	  ccnt = one #Reset counter variable
	  ]
        else, ccnt = ccnt + one #Increment counter
	]

prapidout       #Output to NC of linear movement - rapid               
      if convert_rpd$, pconvert_rpd
      pcan1, pbld, pncount, [if gcode$, `sgfeed], sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, [if gcode$, `feed], strcantext, pscool, e$
      #Modify following line to customize output for high-speed toolpath
      #tool inspection/change points
      if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

plinout         #Output to NC of linear movement - feed                    
      pcan1, pbld, pncount, sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, feed, strcantext, pscool, e$
      #Modify following line to customize output for high-speed toolpath
      #tool inspection/change points
      if rpd_typ$ = 7, pbld, n$, "M00", "(TOOL INSPECTION POINT - POST CUSTOMIZATION REQUIRED)", e$

pcirout         #Output to NC of circular interpolation
      pcan1, pbld, pncount, `sgfeed, sgplane, sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, parc, feed, strcantext, pscool, e$

  • Like 1
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

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