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 outputs 54=G54, 55=G55


Newbeeee™
 Share

Recommended Posts

Hi All,

This query has grown from an earlier post ref G54 output.

Big thanks to ColinG@Boeing for pointing me in the right direction, but I'm not quite there.

 

What I want is to be able to enter 54/55/56/57/58/59 accordingly into the work offset box, and have it output G54/G55/G56 etc.

I have left the existing part of the post to allow -1 and 0 for G54, 1 for G55 etc so this will allow us to either work as we always have, and have the option of working this new way.

Below is the PWCS section (fanuc4axis):

 

 

pwcs #G54+ coordinate setting at toolchange

if mi1$ > one,

[

sav_frc_wcs = force_wcs

if sub_level$, force_wcs = zero

if sav_mi9 = 1, workofs$ = sav_workofs

if workofs$ <> prv_workofs$ | (force_wcs & toolchng),

[

if workofs$ < 6,

[

g_wcs = workofs$ + 54

*g_wcs

]

else,

[

if workofs$ = 6 to 53, pwcs_error<<<<<<[HOW DO I WRITE THIS CORRECTLY?]

if workofs$ = 54, g_wcs = workofs$, *g_wcs

if workofs$ = 55, g_wcs = workofs$, *g_wcs

if workofs$ = 56, g_wcs = workofs$, *g_wcs

if workofs$ = 57, g_wcs = workofs$, *g_wcs

if workofs$ = 58, g_wcs = workofs$, *g_wcs

if workofs$ = 59, g_wcs = workofs$, *g_wcs

if workofs$ >= 60, pwcs_error

]

]

force_wcs = sav_frc_wcs

!workofs$

]

 

pwcs_error # Sends an error message to the screen if the programmer enters 6>53 & 60> in the work offsets parameter in the Planes dialog box.

[

result = mprint(spwcserror)

e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" ,e$

" ERROR - SET WORK OFFSET CORRECTLY AND RE-POST ", e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", e$

exitpost$

]

 

 

What it currently does is work correctly for -1 to 5 (outputting G54 to G59), and then posts Error when entering 6 and above.

I know the format is incorrect for one of the lines highlighted, and if I # it out, it works as it should when entering 54/55/56 etc.

However, it doesn't output an error message when entering 6 to 53.

60 and above outputs an error, so I assume it's the format for the one highlighted line that is incorrect?

 

Appologies for the long post, but hopefully this will help someone if they want to be able to work the same way (providing I can get this working!)

Many thanks in advance for any pointers.

Cheers,

Terry

Link to comment
Share on other sites

I did some testing over the weekend and this doesn't work.

 

With the post changed as per guru's suggestion, -1 to 5 input = 54 to 59 output (correct).

6 to 53 input = error output (correct).

54 to 59 input = error output (incorrect).

60 and above input = error output (correct).

 

So I can only assume that the format of the line

if workofs$ = > 5 & workofs$ < 54, pwcs_error

is not correct?

 

If I # out the line, then 54 to 59 input = 54 to 59 output. But the error message doesn't then show for the incorrect input values.

 

Anyone got any thoughts?

Thanks,

Terry

Link to comment
Share on other sites

This is working fine for me.

 

code:

pwcs_error # Sends an error message to the screen if the programmer enters 6>53 & 60> in the work offsets parameter in the Planes dialog box.

[

result = mprint(spwcserror)

e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" ,e$

" ERROR - SET WORK OFFSET CORRECTLY AND RE-POST ", e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", e$

exitpost$

]

 

pwcs #G54+ coordinate setting at toolchange

if wcstype = two | wcstype > three,

[

sav_frc_wcs = force_wcs

if sub_level$ > zero, force_wcs = zero

if sav_mi9 = 1, workofs$ = sav_workofs

if workofs$ < 0, workofs$ = 0

if workofs$ <> prv_workofs$ | (force_wcs & toolchng) | sof,

[

if workofs$ < 6,

[

g_wcs = workofs$ + 54 #0-6 G54-G59

*g_wcs

]

else,

[

if workofs$ > 5 & workofs$ < 54, pwcs_error

if workofs$ = 54, g_wcs = workofs$, *g_wcs #54-59 G54-G59

if workofs$ = 55, g_wcs = workofs$, *g_wcs

if workofs$ = 56, g_wcs = workofs$, *g_wcs

if workofs$ = 57, g_wcs = workofs$, *g_wcs

if workofs$ = 58, g_wcs = workofs$, *g_wcs

if workofs$ = 59, g_wcs = workofs$, *g_wcs

if workofs$ > 59, pwcs_error

]

]

]

force_wcs = sav_frc_wcs

!workofs$

]

Link to comment
Share on other sites

Here's another variation with extended offsets. G54.1 P1 and up.

 

code:

spwcserror  "WARNING - WCS OUT OF RANGE 0-6 = G54-G59, 54-59 = G54-G59, 101 AND UP = G54.1 P1 AND UP"

 

#################################################

 

 

pwcs_error # Sends an error message to the screen if the programmer enters 6 thru 53 or 60 thru 100 in the work offsets parameter in the Planes dialog box.

[

result = mprint(spwcserror)

e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" ,e$

" ERROR - SET WORK OFFSET CORRECTLY AND RE-POST ", e$

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$", e$

exitpost$

]

 

pwcs #G54+ coordinate setting at toolchange

if wcstype = two | wcstype > three,

[

sav_frc_wcs = force_wcs

if sub_level$ > zero, force_wcs = zero

if sav_mi9 = 1, workofs$ = sav_workofs

if workofs$ < 0, workofs$ = 0

if workofs$ <> prv_workofs$ | (force_wcs & toolchng) | sof,

[

if workofs$ < 6,

[

g_wcs = workofs$ + 54 #0-6 G54-G59

*g_wcs

]

if workofs$ > 5 & workofs$ < 54, pwcs_error

if workofs$ > 53 & workofs$ < 60,

[

g_wcs = workofs$ #54-59 G54-G59

*g_wcs

]

if workofs$ > 59 & workofs$ < 101, pwcs_error

if workofs$ > 100,

[

p_wcs = workofs$ - 100 #101+ G54.1 P1+

"G54.1", *p_wcs

]

]

]

force_wcs = sav_frc_wcs

!workofs$

]

 

[ 11-09-2009, 07:54 AM: Message edited by: Mastercam Guru ]

Link to comment
Share on other sites

if workofs$ = > 5 & workofs$ < 54, pwcs_error

 

As you can see, I had the format wrong by adding the = to the statement.

Funny thing was when testing I looked and looked and didn't see it...

 

Anyway, yes it works like a charm. So BIG thanks Guru and Colin G [boeing] for initially pointing me in the right direction.

HTH someone else.

Cheers,

Terry

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