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:

Adding work offset to sequence number.


Recommended Posts

I am modifying the MPFAN post to allow sequence numbers to show only on tool and work offsets changes. I have accomplished that part with my sequence numbers increasing by 1. I would like for the work offset number to follow my sequence number (IE n154, n254, n354, n455, n554). Any suggestions on how to insert the work offset number to follow behind my sequence number?

Link to comment
Share on other sites


n$ = seqinc$ + workofs$

Is there a different string to be using besides "workofs$" I am getting the format I want but it will only use the work offset number from the first sequence number and not the current work offset number. 


 

 

Link to comment
Share on other sites
2 hours ago, dmaier said:


 

n$ = seqinc$ + workofs$

Is there a different string to be using besides "workofs$" I am getting the format I want but it will only use the work offset number from the first sequence number and not the current work offset number. 



 

 

Really going to comes down to where and how you have done it. pwcs is normally how a work offet is output so not sure what the workofs$ is doing that might be over ridding what pwcs is outputting.

Link to comment
Share on other sites

I originally was using the p_wcs string in place of workofs$ with no output recognition. I switched to the g_wcs string and was able to get my offset number to show correctly but it was resetting my count after 5 sequence numbers. I changed the seqinc$ string to op_id$. That doubled my count of the 5th sequence number output.  Using workofs$ did not alter my sequence number count, but  did not modify the offset number after the first sequence number. I am going to start trying these combinations in different locations now. I had been inserting this code in the psof0$ section of the post. 


 
Link to comment
Share on other sites
3 hours ago, C^Millman said:

Really going to comes down to where and how you have done it. pwcs is normally how a work offet is output so not sure what the workofs$ is doing that might be over ridding what pwcs is outputting.

I finally got the output I was looking for. Created the block below and inserted "op_num" into blocks psof$, ptlch$, and ptlch0$.

#Format sequence number variables
op_num : 0     
fmt    "N" 4 op_num   
g_wcs = workofs$ + 54
op_num = opinfo(15240, 0) * 100 + g_wcs

I could not get any work offset data out of the p_wcs so I stuck with g_wcs string. Is there something I need to do to pull information from p_wcs?

 

Link to comment
Share on other sites

p_wcs is a post block.....a post block generally contains several lines of information that gets processed, by itself it does not output any info, what outputs the info is the variables   contained within the post block...

g_wcs is a variable that actually contains the offset info....

as a general rule, if something begins with a P it's a post block

Link to comment
Share on other sites
I am not sure if this would of effected my WCS output so I changed and added a 1 to the g_wcs and p_wcs. I took and modified the pwcs post block to help with the format the sequence numbers. I have the outcome I was looking for. Was I correct by redefining g_wcs to g_wcs1 or did I just create more lines than necessary in my post? I am still trying to get the hang of this and want to keep the code as clean as possible. 
 
 
#Sequence number format
op_num0   : 0     #Format statement for G54 WCS Operation Number Variable
op_num1   : 0     #Format statement for G54.X WCS Operation Number Variable
pseqnum   : 0     #Format statement for sequence number post block Variable
fmt  " " 4  pseqnum      #Format statement for sequence number post block
fmt  "N" 4  g_wcs1       #Format statement for G54 WCS
fmt  ""  4  p_wcs1       #Format statement for G54.X WCS
fmt  ""  4 op_num0    #Format statement for G54 WCS Operation Numbers
fmt  ""  4 op_num1    #Format statement for G54.X WCS Operation Numbers
op_num0 = opinfo(15240, 0) * 100
op_num1 = opinfo(15240, 0) * 1000
pseqnum            #G54+ coordinate settings for sequence numbers
          [
          if workofs$ < 6,
            [
            g_wcs1 = op_num0 + workofs$ + 54
            *g_wcs1
            ]
          else,
            [
            p_wcs1 = (op_num1) + (54 * 10) + (workofs$ - five)
            "N", *p_wcs1
            ]
          ]
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...