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:

outpur r with g96


88Matt
 Share

Recommended Posts

code:

# Toolchange / NC output Variable Formats

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

fmt T 7 toolno #Tool number

fmt G 4 g_wcs #WCS G address

fmt P 4 p_wcs #WCS P address

fmt S 4 speed #Spindle Speed

fmt M 4 gear #Gear range

fmt S 4 maxss$ #RPM spindle speed

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

fmt N 4 n$ #Sequence number

fmt X 12 xabs #X position output #drr was 2

fmt Y 2 yabs #Y position output

fmt Z 12 zabs #Z position output #drr was 2

fmt U 3 xinc #X position output

fmt V 3 yinc #Y position output

fmt W 3 zinc #Z position output

fmt I 3 iout #Arc center description in X

fmt J 3 jout #Arc center description in Y

fmt K 3 kout #Arc center description in Z

fmt R 2 arcrad$ #Arc Radius

fmt R 12 css_r #css start position #lmr added line test

fmt F 18 feed #Feedrate

fmt P 11 dwell$ #Dwell

fmt M 5 cantext$ #Default cantext

.

.

.

.

.

pcss #Output Constant surface speed

speed = g_speed

if css_actv$, pbld, n$, *sg9697, *speed, spindle_l, pfcss_r, pfxout, !css_actv$ e$ #lmr pfxout is added just for reference

!speed

.

.

.

.

pfcss_r #css start position #lmr added block

*css_r

gives me

 

code:

N10 G20 G90 G08

N20 G0 X20. Z20.

N30 G97 S100 M03 M62

N40 G0 X7.6372 Z10. M8

N50 G92 S320

N60 G96 S200 R0. X7.6372 #<<<<<<<need this line to read G96 S200 R7.6372

How do I get the current x position to post with an R.

 

Thank you in advance for your help.

 

Matt

Link to comment
Share on other sites

There are a couple of ways to achieve this but it depends on what you want to happen from a modality standpoint. for the example above we can get it to output R7.6372 now the next line has the same X, does X need to come out again as X7.6372 or should there be no X.

 

Modality in tact (in the example above no X on the second line if the same as R) - If you want modality to stay in affect then learn to use the nwadrs function. This function allows you to change the address string so the new string address gets output when a variable is output. So you could actually use nwadrs to give say xabs a string of R and then after the output use nwadrs to change it back to X. By using the same output variable and just changing the string address modality stays in tact. This requires that you have string variables defined for both R and X and you use the nwadrs function before and after the output to change and reset respectively. there is much more to this because of accounting for Absolute and incremental that once again if this doesn't make much sense, let your reseller or someone with post experience make the changes.

 

Here is an example but I can't guarantee it will work in your post (The example below assumes strr and strx have been defined appropriately. Notice I removed the call to pfxout from the pcss postblock as well. The call to output was moved to the pcss_r postblock instead).

 

code:

pcss            #Output Constant surface speed

speed = g_speed

if css_actv$, pbld, n$, *sg9697, *speed, spindle_l, pfcss_r, !css_actv$ e$ #lmr pfxout is added just for reference

!speed

 

pfcss_r

#Based on ABS/INC output change the address of appropriate variable from X to R

if absinc$ = zero, result = nwadrs (strr, xabs) #Absolute output

else, result = nwadrs (strr, xinc) #incremental output

pfxout #Call to output X

result = nwadrs (strx, xabs) #reset back to X address

result = nwadrs (strx, xinc) #Reset back to X address


If you don't want to keep modality in tact, then you can just assign the current value into the css_r variable like so

 

code:

   css_r = xabs


Ofcourse the above won't work completely because you have to account for outputting in Absolute (xabs) or incremental mode (xinc). You would need to add more logic for the above to work correctly. Something like this (you would also need to remove pfxout from the pcss postblock otherwise you would get R7.6372 X7.6372 on the same line).

 

code:

  pfcss_r

if absinc$ = zero, css_r = xabs

else, css_r = xinc

*css_r


If none of this makes much sense, that should be a sign to contact your reseller for help so someone with post experience can make the change for you. If you don't understand the basic rules of posts you will just get deeper into trouble trying to make this modification. ALWAYS BACK UP YOUR POST BEFORE MAKING ANY MODIFICATIONS - yes I'm yelling.

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