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:

Angle parameter breaking to get the value output


Recommended Posts

Hi guys!

 

I'm looking for a possibility to break my angle parameters in the postprocessor (p_out, s_out) to get the output value of it only in degrees without the letters C or A.


For example: G0 C45. A54.736 <-----      with the post line like this  (pcan1, pbld, n$, *sg00,*p_out, *s_out, e$)

                      G0 45. 54.736      <-----      with the post line like this  (??????????????)

 

There is no NCI output for them, I think they are calculated inside encrypted PSB file (correct me please), so how I can get does values as an output to my NC code, I need to put them to my angle recalculation macros line for 5x mill.

Thank you for any advices!

Link to comment
Share on other sites

Hi guys!

 

I'm looking for a possibility to break my angle parameters in the postprocessor (p_out, s_out) to get the output value of it only in degrees without the letters C or A.

For example: G0 C45. A54.736 <-----      with the post line like this  (pcan1, pbld, n$, *sg00,*p_out, *s_out, e$)

                      G0 45. 54.736      <-----      with the post line like this  (??????????????)

 

There is no NCI output for them, I think they are calculated inside encrypted PSB file (correct me please), so how I can get does values as an output to my NC code, I need to put them to my angle recalculation macros line for 5x mill.

 

Thank you for any advices!

 

 

I'm not sure why you would want that, but you need to change the format. For example, the below example will change the 'cabs' variable to NOT post a 'B' prior to it.

 

fmt  "B" 11 cabs        #C axis position

To

fmt  "" 11 cabs        #C axis position

Link to comment
Share on other sites

Thank you Ray for the advice! but there is some issues with this:

 

I cant change the parameters of an angles because, I need them without letters only at my offset recalculation line, in other turns I need letters of course! 

 

I made some changes manually to show how I want program to look:

 

Capture8

 
That's the post part which need to be modificated (look at -->????):
 

Capture9

 

 

Thank you for advices!!

Link to comment
Share on other sites

So you can create another variable with the correct preceding characters and transfer to that when needed. Something like below.

 

Format section:

fmt  "B" 11 cabs        #C axis position

fmt  "PC=" 11 cabs_calc        #C axis position calculation

fmt  "PA=" 11 aabs_calc        #A axis position calculation

 

Then before you use it you can;

cabs_calc = cabs    ( this transfer the value into cabs_calc with the PC= preceding letters )

aabs_calc = ????    (this does the same thing for the A axis but I wasn't sure how your axis is defined, hence the ????)

 

Then;

 

pcan1, pbld, n$, "CALL 0088", *cabs_calc, *aabs_calc, "PH=1 PP=100", e$

 

 

Does this make sense?

 

There are other ways to accomplish this, and many people on here that are way better at this than me. Maybe they can give you another way or explain this better.

Link to comment
Share on other sites

So you can create another variable with the correct preceding characters and transfer to that when needed. Something like below.

 

Format section:

fmt  "B" 11 cabs        #C axis position

fmt  "PC=" 11 cabs_calc        #C axis position calculation

fmt  "PA=" 11 aabs_calc        #A axis position calculation

 

Then before you use it you can;

cabs_calc = cabs    ( this transfer the value into cabs_calc with the PC= preceding letters )

aabs_calc = ????    (this does the same thing for the A axis but I wasn't sure how your axis is defined, hence the ????)

 

Then;

 

pcan1, pbld, n$, "CALL 0088", *cabs_calc, *aabs_calc, "PH=1 PP=100", e$

 

 

Does this make sense?

 

There are other ways to accomplish this, and many people on here that are way better at this than me. Maybe they can give you another way or explain this better.

 

You'll probably need to initialize those new variables too.

 

At the beginning of the post you'll see where everything is initialized... Just add them there...Somewhere logical.

 

something like;

cabs_calc   : 0   #c angle position for offset

 

J

Link to comment
Share on other sites

Hello guys! 

The main problem is that my format section looks like this (Generic Haas VF Trunnion post):
 

fmt  "C" 20 p_out       #Primary output axis position
fmt  "A" 20 s_out       #Secondary output axis position

and changing the letters does NOT react my output at all!
 
it reacts only in this place:
 
# --------------------------------------------------------------------------
# 5 Axis Rotary Settings
# --------------------------------------------------------------------------
#Assign axis address
str_pri_axis : "C"
str_sec_axis : "A"
 
str_pri_axis : ""    it works good but I need it only in one particular section!
str_sec_axis : ""   it works good but I need it only in one particular section!
 
I'm thinking about adding some logic like this
 
str_pri_axis : "C"
str_sec_axis : "A"
str_pri_axis_calc : ""    
str_sec_axis_calc : ""
 
and another section with some logic like this (I want to show only logic, the syntax is wrong here, any advices to write it down correctly?)
 
 
p_out_calc           #C Angle without letter
 
      if RECALCULATION = one                     (will set this at one in the tables)
        [
        str_pri_axis  = str_pri_axis_calc          (str_pri_axis ( with the letter C are getting NO letter) 
        p_out                                                   (Angle output without letter)
        ]
 
 
And after: pcan1, pbld, n$, "CALL 0088", *p_out_calc , *s_out_calc , "PH=1 PP=100", e$
 
But I'm stucked with the syntax and place in the MP to insert that kind of logic, any advices will be helfpul!! Thank you!
 
Link to comment
Share on other sites

You may be overthinking it a little.

If I understand you correctly, your post is working OK, you simply need to change the prefix of the plane calculation commands, right?

 

I did an example up on my generic fadal post to test that it's working. In my example, I will output the X,Y, and Z with a new prefix.

 

So, here's what you need to do;

 

1. add 3 new variables to the post named whatever you like.

# --------------------------------------------------------------------------

# Common User-defined Variable Initializations (not switches!)
# --------------------------------------------------------------------------
jayx     : 0     #added by me for fun
jayy     : 0     #added by me for fun
jayz     : 0     #added by me for fun

 

2. add 3 new format statements to alter the prefix

fmt  "jayX" 2  jayx        #added by jays for fun
fmt  "jayY" 2  jayy        #added by jays for fun
fmt  "jayZ" 2  jayz        #added by jays for fun

 

3. make the new variables equal the actual values and output them where you like. in my example I added it to the the "prapidout"

prapidout       #Output to NC of linear movement - rapid 
jayx = xabs
jayy = yabs
jayz = zabs            
      pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, pcout, strcantext, scoolant, jayx, jayy, jayz, e$

 

4. Post and enjoy.

 

Here is a sample of code filled with bogus X,Y, and Z moves all with my "jay" prefix. OBVIOUSLY it's not cleaned up but it illustrates the concept.

 

N100 G00 G17 G20 G40 G49 G80 G90
N110 T7 M06 ( 1/2 FLAT ENDMILL)
N120 (MAX - Z5.)
N130 (MIN - Z-.15)
N140 G00 G90 E1 X4.2475 Y-2.6461 S1069 M03
N150 G43 H7 Z5. M08
N160 Z.1 jayX4.2475 jayY-2.6461 jayZ.1
N170 G01 Z-.15 F6.42
N180 G41 D7 X4.0707 Y-2.4693
N190 G03 X4. Y-2.44 I-.0707 J-.0707
N200 G01 X3.75
N210 X0.
N220 X-.25
N230 G03 X-.3207 Y-2.4693 I0. J-.1
N240 G01 G40 X-.4975 Y-2.6461
N250 G00 Z1. jayX-.4975 jayZ1.
N260 X4.2475 Y-2.4961 jayX4.2475 jayY-2.4961
N270 Z.1 jayZ.1

 

J

Link to comment
Share on other sites

WORKED!!! Thank you a lot, for a help!!!

 

I changed the formats of new variables (for wcs aswell)  and the script now looks like this:

 

Capture11

 
Now I can only insert "poffsetrecalculation" where I need it.
 
Thank you again for a step by step help! now I can go forward!!!

 



 

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