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:

Parameter for XYZ approach/ retract value, check boxes


Recommended Posts

hello everyone,
   I tried to look parameter numbers in the PDF file of which the dealer provided and i couldn't find them.  Please help.

 

   I also tried to use this command but didn't work well for me,  is there any other ways to find out about it?

"pparameter", ~prmcode$, ~sparameter$, e$

 

Thank you.

Untitled.png

Link to comment
Share on other sites

I was looking into these parameters.  Read my posts towards the end.  You can easily check to see if any of the check boxes are checks, but understand that the parameter values will be output in world coordinates regardless what is input in the boxes.  If someone knows more on the numerical values, it would be helpful.

Link to comment
Share on other sites

prmcode$ 12258. - Use Retract Checkbox
prmcode$ 12259. - World X Retract
prmcode$ 12260. - World Y Retract
prmcode$ 12261.  - World Z Retract

prmcode$ 15106. - Use approach Checkbox.

prmcode$ 10080. - World X Approach
prmcode$ 10081. - World Y Approach
prmcode$ 10082. - World Z Approach 


prmcode$ 15327. - Status of all checkboxes and radio selectors as an integer value representing each item as a bit,  ex 238. = 11101110 (xa,ya,za,a/i,xr,yr,zr,a/i) 

  • Like 1
Link to comment
Share on other sites
4 hours ago, So not a Guru said:

Why would that be true? There are boxes to select Absolute or Incremental.

Well from what I have gathered over the years those boxes have a bit of programming behind them...  This is what forces us to have the need to want to know what is going on in them to check them in the post because they don't output to NCI properly. I would imagine this is due to the translations that they do are failing for whatever reason when you enter numbers in and regen.  If they were straight parameters things would be easy, but for functionality purposes, they can't be that simple...  Otherwise you wouldn't just be able to enter in z10 inc and get what you are a looking for in the nci and posted code.

As for the parameters being in world coordinate.  If I had to venture a guess, just like xr$... its up to the post writer to translate those values as needed.  If you output everything in tplane coordinates, no extra math should be needed, if you don't use topmap, and have a 5 axis head/head I have found implementing a solution for the lack of output of these to be a bit more cumbersome.

Good luck, and I would be more than willing to share more notes on this to help come up with a decent solution.  I need to get pointed in the right direction on how to translate these points based on tool plane and world orientation matrices.  I get that figured out and we are in like flynn.

  • Like 2
Link to comment
Share on other sites
On 27/06/2017 at 8:12 AM, huskermcdoogle said:

Well from what I have gathered over the years those boxes have a bit of programming behind them...  This is what forces us to have the need to want to know what is going on in them to check them in the post because they don't output to NCI properly. I would imagine this is due to the translations that they do are failing for whatever reason when you enter numbers in and regen.  If they were straight parameters things would be easy, but for functionality purposes, they can't be that simple...  Otherwise you wouldn't just be able to enter in z10 inc and get what you are a looking for in the nci and posted code.

As for the parameters being in world coordinate.  If I had to venture a guess, just like xr$... its up to the post writer to translate those values as needed.  If you output everything in tplane coordinates, no extra math should be needed, if you don't use topmap, and have a 5 axis head/head I have found implementing a solution for the lack of output of these to be a bit more cumbersome.

Good luck, and I would be more than willing to share more notes on this to help come up with a decent solution.  I need to get pointed in the right direction on how to translate these points based on tool plane and world orientation matrices.  I get that figured out and we are in like flynn.

Thank you for helping me out, I've tried and honestly it is a big issue for me to figure out how to make the post spits out the notes as I wanted for APPROACH and RETRACT with BINARY CODES.

 

 

Although I've spent more than a week with no luck but I truly appreciate for your responds.

Link to comment
Share on other sites

What exactly are you trying to accomplish?  If you are just trying to get a comment to come out when you are using the check boxes,  That should very straightforward.  

Do you understand how to capture parameter values?  If so, then you just need to do a bitwise and comparison on which box is selected.

Say you wanted to test if the approach x checkbox was selected.

The parameter value will come back as an integer made up by the individual bits.  If it is the only box selected, it will come back as a 2.  But likely this isn't what you will get back, because you probably have more than one box selected.  This is where the bitwise and comes in.

You will do a test on the integer value.   return = and(2, parameter 15327).  If the second bit from the right is on, the value of return will be 1 otherwise it will be 0.  SImple as that.  Now so you don't need a binary table, you can simply use 2 to the power of the bit position.  Say for the first bit it would be 2^0, second 2^1, third 2^2, so one so forth, and you can enter it in the bitwise funtion just like this. 

To create a quick test, 

add the following in the the appropriate post bocks

declare the following variable in the declarations:

ref_stat_int  : 0

 

To gather the parameter value, in pparameter$ add:

if prmcode$ = 15327, ref_stat_int = rpar(sparameter$,1)

 

add the output comments where you want to see it say in your toolchange and null toolchange post blocks.

 

	if and(2^1,ref_stat_int), "(X APPROACH ON)", e$
	if and(2^2,ref_stat_int), "(Y APPROACH ON)", e$
	if and(2^3,ref_stat_int), "(Z APPROACH ON)", e$
	if not(and(2^4,ref_stat_int)), "(ABSOLUTE)", e$
	else,  "(INCREMENTAL)", e$

 

Give this a shot and feel free to ask for a most complete explanation.  I can try to get a grasp of English...

  • Like 1
Link to comment
Share on other sites
On 7/5/2017 at 8:49 AM, huskermcdoogle said:

What exactly are you trying to accomplish?  If you are just trying to get a comment to come out when you are using the check boxes,  That should very straightforward.  

Do you understand how to capture parameter values?  If so, then you just need to do a bitwise and comparison on which box is selected.

Say you wanted to test if the approach x checkbox was selected.

The parameter value will come back as an integer made up by the individual bits.  If it is the only box selected, it will come back as a 2.  But likely this isn't what you will get back, because you probably have more than one box selected.  This is where the bitwise and comes in.

You will do a test on the integer value.   return = and(2, parameter 15327).  If the second bit from the right is on, the value of return will be 1 otherwise it will be 0.  SImple as that.  Now so you don't need a binary table, you can simply use 2 to the power of the bit position.  Say for the first bit it would be 2^0, second 2^1, third 2^2, so one so forth, and you can enter it in the bitwise funtion just like this. 

To create a quick test, 

add the following in the the appropriate post bocks

declare the following variable in the declarations:

ref_stat_int  : 0

 

To gather the parameter value, in pparameter$ add:

if prmcode$ = 15327, ref_stat_int = rpar(sparameter$,1)

 

add the output comments where you want to see it say in your toolchange and null toolchange post blocks.

 


	if and(2^1,ref_stat_int), "(X APPROACH ON)", e$
	if and(2^2,ref_stat_int), "(Y APPROACH ON)", e$
	if and(2^3,ref_stat_int), "(Z APPROACH ON)", e$
	if not(and(2^4,ref_stat_int)), "(ABSOLUTE)", e$
	else,  "(INCREMENTAL)", e$

 

Give this a shot and feel free to ask for a most complete explanation.  I can try to get a grasp of English...

Thank you for your big help, Husker.  I'm trying to capture the value of XYZ of RETRACT, APPROACH and ...... I don't know why I failed.  

I am trying to make the post put a warning message for me saying that "HEY, YOU HAVE AN APPROACH MOVING AT  X..... (VALUE), Y..... (VALUE) OR Z..... (VALUE)".

 

This is what I did, please tell me what I've done wrong.  I've tried for a week and i don't know what I've done wrong.

 

ZApproachOnOff: 0
YApproachOnOff: 0
XApproachOnOff: 0
ApproachABSINC: 0
ZRetractOnOff: 0
YRetractOnOff: 0
XRetractOnOff: 0
RetractABSINC: 0

sXApproach: 0
sYApproach: 0
sZApproach: 0
sXRetract: 0
sYRetract: 0
sZRetract: 0
#Region sXApproach
sXApproach = "X APPROACH is ON"
             +no2asc(13) + "X:" + no2str(x_refapp)
             +no2asc(13)
             +no2asc(13)
             +no2asc(13) + "If you think this is a mistake, do these following steps"
             +no2asc(13) + "Step 1 = Left click on: TOOLPATH PARAMETERS"
             +no2asc(13) + "Step 2 = Left click on: HOME/ REF. POINTS"
             +no2asc(13) + "Step 3 = Left click on: UNCHECK at the REFERERNCE POINT"
             +no2asc(13) + "Step 4 = Click on GREEN CHECK" 
             +no2asc(13)
             +no2asc(13)+"Click OK to go back to MASTERCAM to fix this issue NOW!!!"
#EndRegion
#Region sYApproach
sYApproach = "Y APPROACH is ON"
             #+no2asc(13) + "X:" + no2str(x_refret)
             +no2asc(13) + "Y:" + no2str(Y_refapp)
             #+no2asc(13) + "Z:" + no2str(Z_refret)
             +no2asc(13)
             +no2asc(13)
             +no2asc(13) + "If you think this is a mistake, do these following steps"
             +no2asc(13) + "Step 1 = Left click on: TOOLPATH PARAMETERS"
             +no2asc(13) + "Step 2 = Left click on: HOME/ REF. POINTS"
             +no2asc(13) + "Step 3 = Left click on: UNCHECK at the REFERERNCE POINT"
             +no2asc(13) + "Step 4 = Click on GREEN CHECK" 
             +no2asc(13)
             +no2asc(13)+"Click OK to go back to MASTERCAM to fix this issue NOW!!!"
#EndRegion

 

 

#Region sZApproach
sZApproach = "Z APPROACH is ON"
	     +no2asc(13) + "Z:" + no2str(z_refapp)
             +no2asc(13)
             +no2asc(13)
             +no2asc(13) + "If you think this is a mistake, do these following steps"
             +no2asc(13) + "Step 1 = Left click on: TOOLPATH PARAMETERS"
             +no2asc(13) + "Step 2 = Left click on: HOME/ REF. POINTS"
             +no2asc(13) + "Step 3 = Left click on: UNCHECK at the REFERERNCE POINT"
             +no2asc(13) + "Step 4 = Click on GREEN CHECK" 
             +no2asc(13)
             +no2asc(13)+"Click OK to go back to MASTERCAM to fix this issue NOW!!!"
#EndRegion

 

 

# --------------------------------------------------------------------------
# Format for Reference Points
fmt ""   4  enable_refret # is Retract Ref Point Enabled?
fmt ""   2  x_refret # x Retract ref Point
fmt ""   2  y_refret # y Retract ref Point
fmt ""   2  z_refret # z Retract ref Point
fmt ""   2  enable_refapp # is Approach Ref Point Enabled?
fmt ""   2  x_refapp # x Approach ref Point
fmt ""   2  y_refapp # y Approach ref Point
fmt ""   2  z_refapp # z Approach ref Point
sapp_ret : "" # String to capture binary state of approach and retract checkboxes

 

 

           if prmcode$ = 12258, enable_refret = rpar(sparameter$, 1) # is Approach Ref Point Enabled?
           if prmcode$ = 12259, x_refapp = rpar(sparameter$, 1)
           if prmcode$ = 12260, y_refapp = rpar(sparameter$, 1)
           if prmcode$ = 12261, z_refapp = rpar(sparameter$, 1)

           if prmcode$ = 15327,
             [
              ZApproachOnOff = rpar(sparameter$, 8)
              YApproachOnOff = rpar(sparameter$, 7)
              XApproachOnOff = rpar(sparameter$, 6)
              ApproachABSINC= rpar(sparameter$, 5)
              ZRetractOnOff = rpar(sparameter$, 4)
              YRetractOnOff = rpar(sparameter$, 3)
              XRetractOnOff = rpar(sparameter$, 2)
              RetractABSINC = rpar(sparameter$, 1)
             ]
pheader$         #Call before start of file  
      [   
      if errorcheck = 1,
        if enable_refapp = one & x_refapp <> 0, [if mprint(sXApproach, 2) = 2, exitpost$]#Warn for Xapproach
	if enable_refapp = one & y_refapp <> 0, [if mprint(sYApproach, 2) = 2, exitpost$]#Warn for Yapproach
	if enable_refapp = one & Z_refapp <> 0, [if mprint(sZApproach, 2) = 2, exitpost$]#Warn for Zapproach

        if enable_refret = one & x_refret <> 0, [if mprint(sXRetract, 2) = 2, exitpost$]#Warn for Xapproach
	if enable_refret = one & Y_refret <> 0, [if mprint(sYRetract, 2) = 2, exitpost$]#Warn for Yapproach
	if enable_refret = one & z_refret <> 0, [if mprint(sZRetract, 2) = 2, exitpost$]#Warn for Zapproach
      ]  
Link to comment
Share on other sites

If you are doing everything in top/top world.  This shouldn't be hard.  If not, good luck.  I would like to figure this out myself but don't posses all needed post knowledge yet to do so.  Another month or so, and I should have it sorted.

Otherwise, can you post what you are or are not getting for output currently?  We can at least possibly debug the check boxes part of it.

Link to comment
Share on other sites

Also, this is incorrect.

if prmcode$ = 15327,
             [
              ZApproachOnOff = rpar(sparameter$, 8)
              YApproachOnOff = rpar(sparameter$, 7)
              XApproachOnOff = rpar(sparameter$, 6)
              ApproachABSINC= rpar(sparameter$, 5)
              ZRetractOnOff = rpar(sparameter$, 4)
              YRetractOnOff = rpar(sparameter$, 3)
              XRetractOnOff = rpar(sparameter$, 2)
              RetractABSINC = rpar(sparameter$, 1)
             ]

 You can't get the status of the individual bits using rpar, as 15327 is an integer!  You need to use a bit mask ( and() ) to determine if the bit you are testing for is on.  This is explained fairly well in the my post you quoted.

 

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