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:

Work Offset Promt


Recommended Posts

Hello everyone,
   My setup guys quite often asking to change the work offset such as I have in mastercam "0" as G54 and they want G59, sure they can do that at the control and so mastercam but I know there is away that we can change it at the moment we post it out.    Like the post would ask:  Do you want other than this work offset "G54"?  Then I just input my value as 55 Then it would post all of my  work offset G54 becomes G55.  

 

   I think there is a "Q" function post add in right?  Not sure, 3 years ago I saw someone did that and I tried to search, not much help for me to start where I wonder.  Please help.

This is what I'm guessing.... (Please help, thank you.)
 

 --------------------------------------------------------------------------
# Misc strings
# --------------------------------------------------------------------------
sMyCustomedWorkOffSet: ""


# --------------------------------------------------------------------------
# Question format statements
# --------------------------------------------------------------------------
fq sMyCustomedWorkOffSet


ptlchg_com      #Tool change common blocks
  if sMyCustomedWorkoffset > 0, sMyCustomedWorkoffset = pwcs, e$
  pbld, no_spc$, no_spc$, [if cinc, sgcode, sgplane], [if not(index), sgabsinc, pwcs], [ if cinc, pfcout], strcantext,  # Positioning work offset here


ptlchg0$         #Call from NCI null tool change (tool number repeats)
   if sMyCustomedWorkoffset > 0, sMyCustomedWorkoffset = pwcs, e$
   pbld, no_spc$, *sg00, *sg90, *g_wcs, pfzout, pfspindleout,
Link to comment
Share on other sites
14 hours ago, PcRobotic said:

 I think there is a "Q" function post add in right?  Not sure, 3 years ago I saw someone did that and I tried to search, not much help for me to start where I wonder.  Please help.

There is built in functionality for this in Mp using the "fq" statement. You can find all the info for implementing it in the documentation.

Something like this:

user_origin : 54
originnum   : 54
fmt  "G"    4  user_origin
fq 1 originnum "Enter the Origin Number (ex. 54 - 59):"

And postblocks:

porigin_check

    q1
    if originnum < 54 | originnum > 59, porigin_check
    user_origin = originnum
    poutputorigin

poutputorigin

    n$, *user_origin, e$

Should would work, but just you would have to put the user_origin call everywhere that you want your work offset output. There are probably much better solutions than mine, but you should be able to see how the question function works.

 

Link to comment
Share on other sites
2 hours ago, So not a Guru said:

There is built in functionality for this in Mp using the "fq" statement. You can find all the info for implementing it in the documentation.

Something like this:


user_origin : 54

originnum   : 54

fmt  "G"    4  user_origin

fq 1 originnum "Enter the Origin Number (ex. 54 - 59):"

And postblocks:


porigin_check

    q1
    if originnum < 54 | originnum > 59, porigin_check
    user_origin = originnum
    poutputorigin

poutputorigin

    n$, *user_origin, e$

Should would work, but just you would have to put the user_origin call everywhere that you want your work offset output. There are probably much better solutions than mine, but you should be able to see how the question function works.

 

 

Thank you for your input Guru,
   I tried and it did not show the number I want although I put "55" and it only shows "54".  Can you tell me what I've done wrong?  Here is what I did, thank you so much for your time.


 

# --------------------------------------------------------------------------
# Additional General Output Settings
# --------------------------------------------------------------------------
user_origin : 54
originnum   : 54


# --------------------------------------------------------------------------
# Toolchange / NC output Variable Formats
# --------------------------------------------------------------------------
fmt  "G" 4  user_origin


#Customed Post Block
porigin_check
    q9
    if originnum < 54 | originnum > 59, porigin_check
    user_origin = originnum
    poutputorigin

poutputorigin
    n$, *user_origin, e$

ptlchg_com      #Tool change common blocks
        if not(index), # WORK OFFSET HERE
         [
          pbld, no_spc$, [if prv_sgabsinc, *sgabsinc], pwcs], [q9, poutputorigin], pfxout, pfyout, e$ #=====> This is where I put
          [if speed <> 0, pfspindleout], [if gcode$ = 1, *feed], strcantext, e$ 
          [if swcsplname <> stoolplname, pfcout, else, ""], #[if gcode$ = 1, sgfeed], 
         ]

 
ptlchg0$         #Call from NCI null tool change (tool number repeats)
        if retractflg,
          [
          if safe_index,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            pbld, n$, pgear, e$
            pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], [q9, poutputorigin], pfcout, pspindleout, e$ #=====> This is where I put
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            pbld, n$, pfxout, pfyout, e$
            ]
          else,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            if rotretflg = 1, pbld, n$, "G91 G28 Z0.test2", [if gcode$ = 1, feed], scoolant, e$ # No Tool Change full retract here
            pbld, n$, *sgcode, [if not(index), *sgabsinc, pwcs], pfcout, pfxout, pfyout, pspindleout, e$ # No Tool Change
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            ]
         [
Link to comment
Share on other sites

Okay, I got this figured out a bit... here is what I did but I would like it to push up the PWCS, like I have G54 and G55 in mastercam already and I want to start at G57, then it should be G57, G59.  How can i do that?


I only know how to make it works but I don't know how to make it increment the numbers, please help.
 

[if user_origin > 0, porigin_check, else, *g_wcs]
Link to comment
Share on other sites
1 hour ago, PcRobotic said:

Okay, I got this figured out a bit... here is what I did but I would like it to push up the PWCS, like I have G54 and G55 in mastercam already and I want to start at G57, then it should be G57, G59.  How can i do that?


I only know how to make it works but I don't know how to make it increment the numbers, please help.

I'm not quite sure what you are asking for here.

Link to comment
Share on other sites
4 hours ago, JParis said:

Changing operations offset settings via a prompt question is going to be a bit more involved than just setting the prompt...

Kind of my thought you are taking a built into function of the software and now using it to change it to a method that goes against the very nature of the way the software is meant to be used. It takes me less than a minute to right click on 100 operation and change the work offset. If you using transform and have maintain workoffset then good to go. Everything related to pwcs has to be stripped out of the post or so much logic changed to do it this way I am really having a hard time seeing the need for it. Use the software the way it is supposed to be used and it will do the job you need it. How do you have a record of what was done in the Mastercam file using questions? Why I built all the strings I did years ago to track NC revisions and customer information. I can go back to programs I did 15 years ago and tell you everything I did. This was is to open ended and creates havoc in my opinion. Again not that what I think it the correct way or that I am saying you are doing it wrong. I just cannot find a logical reason to go about it the way your going about it.

Best of luck, but again I think you putting efforts into areas that in the long run are not as productive as it could be put towards other things.

Link to comment
Share on other sites

Thank you for all of your responding.  My goal is to make the guy on the floor have an easier day since they already have too many problems to take care and make them feel appreciated.

 

Therefore, I want to make the post changes things at my finger tips within seconds not minutes.

 

I will look forward how to overcome this.  Once again, thank you for your help.

Link to comment
Share on other sites
32 minutes ago, PcRobotic said:

Thank you for all of your responding.  My goal is to make the guy on the floor have an easier day since they already have too many problems to take care and make them feel appreciated.

 

Therefore, I want to make the post changes things at my finger tips within seconds not minutes.

 

I will look forward how to overcome this.  Once again, thank you for your help.

Cimco edit Replace done in a few seconds. You or they can do what ever you want from there.

  • Like 1
Link to comment
Share on other sites

OK.... FINALLY.... I think I got it but if you see something wrong, please let me know (i'm still learning from the "pro" guys like you)... 


What I did is I tried make make the FQ value add into the PWCS so it is LIVE value not a replacement....  

 

==========================================================================================

# --------------------------------------------------------------------------
# Additional General Output Settings
# --------------------------------------------------------------------------
UserOrigin    : 1
OriginNumber  : 0 #User manual input workoffset other than MasterCam given

# --------------------------------------------------------------------------
# Toolchange / NC output Variable Formats
# --------------------------------------------------------------------------
fmt  "G" 4  UserOrigin


# --------------------------------------------------------------------------
# Question format statements
# --------------------------------------------------------------------------
fq 1 stock_typ "Predator Stock [0=Box,1=Cylindrical]"
fq 2 cyl_typ "Cylindrical Stock Axis [1=X,2=Y,3=Z]"
fq 3 OriginNumber "Enter the Origin Number (0 = G54 ***** 1 = G55 ***** 2 = G56 ***** 3 = G57 ***** 4 = G58 ***** 5 = G59):"

# --------------------------------------------------------------------------
#Customed Post Block
# --------------------------------------------------------------------------
pOriginCheck
    q3
    if OriginNumber < 0 | OriginNumber > 5, pOriginCheck
    UserOrigin = OriginNumber
   if OriginNumber > 0 | OriginNumber > 5, g_wcs = workofs$ + 54 + UserOrigin, else,  g_wcs = workofs$ + 54
    *g_wcs

# --------------------------------------------------------------------------
ptlchg_com      #Tool change common blocks
        if not(index), # WORK OFFSET HERE
         [
          pbld, no_spc$, [if prv_sgabsinc, *sgabsinc], pwcs, [if UserOrigin > 0, pOriginCheck, else, pwcs], pfxout, pfyout, e$ #=====> This is where I put
          [if speed <> 0, pfspindleout], [if gcode$ = 1, *feed], strcantext, e$ 
          [if swcsplname <> stoolplname, pfcout, else, ""], #[if gcode$ = 1, sgfeed], 
         ]

# -------------------------------------------------------------------------- 
ptlchg0$         #Call from NCI null tool change (tool number repeats)
        if retractflg,
          [
          if safe_index,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            pbld, n$, pgear, e$
            pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], [if UserOrigin > 0, pOriginCheck, else, pwcs], pfcout, pspindleout, e$ #=====> This is where I put
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            pbld, n$, pfxout, pfyout, e$
            ]
          else,
            [
            if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$
            if rotretflg = 1, pbld, n$, "G91 G28 Z0.test2", [if gcode$ = 1, feed], scoolant, e$ # No Tool Change full retract here
            pbld, n$, *sgcode, [if not(index), *sgabsinc, pwcs], pfcout, pfxout, pfyout, pspindleout, e$ # No Tool Change
            if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$
            ]
         [
  • Like 1
Link to comment
Share on other sites
22 hours ago, Tim Johnson said:

So there are two threads running supposing to end up with the same result? :o

Hi Tim,
   That's why it keeps asking every time when it has a work offset.  Is there a simple way other than buffer that makes it asks only one time and replaces all the work offset?

 

Thank you Tim.

Link to comment
Share on other sites

I have no need for the question side of the post and therefore no experience with it but off the top of my head I would think if you only want the process run only once then pheader$ or psof$ would be the better place to do the work.

On 4/25/2017 at 5:43 PM, PcRobotic said:

Thank you for all of your responding.  My goal is to make the guy on the floor have an easier day since they already have too many problems to take care and make them feel appreciated.

 

Therefore, I want to make the post changes things at my finger tips within seconds not minutes.

 

I will look forward how to overcome this.  Once again, thank you for your help.

The first thing I do when I try to make the guy on floor have an easier day is to ask them what it will take to do it. Again off the top of my head making the guy on the floor have to call or make the trip to your office as often as each setup is NOT making THEIR day easier, it making YOUR day easier to automate the process. If you ask them they will probably tell you that helping them help themselves is what they would want. In this situation making your work offsets variable may achieve this task. Ask them.

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