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:

Post/Work Offset help needed


Recommended Posts

I modded a MPMaster Post to output the offsets how I'd like. Basically if you leave top plane to defualt "-1" it outputs G55. Set to "0" or "1" outputs G55. "2" outputs G56 and so forth. Set it to 55 and you get G55...

 

Problem is say the first Op is set to 56 and the second op is set to -1 with a Null tool change, it will stay 56 instead of switching mid way to 55.

 

Here's two different posts, one is G offset, other is E offset for a Older Tree Mill. I'm assuming this is all good and the problem lies in the "Null Tool Change".

 

I would also like to default/ force a tool change after a Manual comment if possible using MPMaster.

 

Thanks,

 

Josh-

 

 

pwcs #G54+ coordinate setting at toolchange

 

sav_frc_wcs = force_wcs

if sub_level$, force_wcs = zero

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

[

[

if workofs$ < 6,

[

if workofs$ < 1, g_wcs = 55

else,

g_wcs = workofs$ + 54

]

if workofs$ > 6 & workofs$ < 26, g_wcs = workofs$ + 103

if workofs$ > 54, g_wcs = workofs$

]

[

*g_wcs

]

]

force_wcs = sav_frc_wcs

!workofs$

________________________________________________

 

pwcs #E coordinate setting at toolchange

 

if workofs$ > 0,

[

g_wcs = workofs$

*g_wcs

]

else,

[

g_wcs = 1

*g_wcs

]

Link to comment
Share on other sites

I think your confusion comes from leaving the workofset value in Mastercam to -1. -1 in Mastercam tells mastercam that AUTOMATIC offset generation is on and it will use the toolplanes (views) to determine what value to write to the NCI. -1 will never ever be written to the NCI file, never...did I say never...

 

Mastercam uses the toolplane and tool orin to determine if a change in offset is needed, IE. create an operation in say the top toolplane and one in the side leaving both set to -1. When the NCI is written the workofset values will be 0 and 1 respectively. Now if you had two operations both in the top and set to -1, then because they both use the same view and no change in tool origin the NCI would have 0 & 0 for both operations.

 

Another problem with the first PWCS post block shown above is it looks like you have way to many [] as well as lines that will overwrite everything you are trying to do.

 

My suggestion is to repost the postblocks to a new forum post but make sure you are using the full reply and "CODE" ubb code so the formatting (idententation) of the postblock remains in tact like the one shown below

 

Another suggestion is to see if there is a .err file created when posting as you very well could have errors but not being told about it based on your settings in your Control Definition.

 

code:

pwcs            #G54+ coordinate setting at toolchange

if mi1$ > one,

[

sav_frc_wcs = force_wcs

if sub_level$ > 0, force_wcs = zero

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

[

if workofs$ < 6,

[

g_wcs = workofs$ + 54

*g_wcs

]

else,

[

p_wcs = workofs$ - five

"G54.1", *p_wcs

]

]

force_wcs = sav_frc_wcs

!workofs$

]


Link to comment
Share on other sites

code:

 

pwcs #G54+ coordinate setting at toolchange

 

sav_frc_wcs = force_wcs

if sub_level$, force_wcs = zero

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

[

[

if workofs$ < 6,

[

if workofs$ < 1, g_wcs = 55

else,

g_wcs = workofs$ + 54

]

if workofs$ > 6 & workofs$ < 26, g_wcs = workofs$ + 103

if workofs$ > 54, g_wcs = workofs$

]

[

*g_wcs

]

]

force_wcs = sav_frc_wcs

!workofs$

 


Link to comment
Share on other sites

code:

 

24 Aug 2010 12:41:35 PM - <0> - Report created.

24 Aug 2010 12:41:35 PM - <2> - Initialize posting log file

24 Aug 2010 12:41:35 PM - <2> - Using MP run version 13.00 and post components version 10.00

24 Aug 2010 12:41:35 PM - <2> - Initiate opening the post processor file(s).

24 Aug 2010 12:41:35 PM - <2> - Post processor file name: S:COMPANY DOCSMACHINE SHOPMASTERCAM DATABASECNC_MACHINESHAAS VMCHAAS VMC.PST

24 Aug 2010 12:41:35 PM - <2> - The post processor file has been successfully opened.

24 Aug 2010 12:41:35 PM - <2> - Post version information (input):

24 Aug 2010 12:41:35 PM - <2> - UPDATEPOST Version 13. was used to modify this file.

24 Aug 2010 12:41:35 PM - <2> - The file was modified by this product on 08 Jun 09 06:49:32

24 Aug 2010 12:41:35 PM - <2> - The post was written to run with Mastercam Version 13.

24 Aug 2010 12:41:35 PM - <2> - The post product type is Mill.

24 Aug 2010 12:41:35 PM - <2> - Initialization of pre-defined post variables, strings, postblocks was successful.

24 Aug 2010 12:41:35 PM - <2> - Search for defined post variables, strings, postblocks was successful.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'mtol$' was re-initialized from 0.0001 to 0.00001

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'met_mtol$' was re-initialized from 0.001 to 0.0001

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'ltol$' was re-initialized from 0.0005 to 0.002

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'maxrad$' was re-initialized from 999.9999 to 999.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'met_maxrad$' was re-initialized from 9999.999 to 9999.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'helix_tol$' was re-initialized from 0.0005 to 0.0001

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'met_helix_tol$' was re-initialized from 0.005 to 0.001

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'atol$' was re-initialized from 0.5 to 0.01

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'err_file$' was re-initialized from 0. to 4.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'dec_seq_right$' was re-initialized from 3. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'dec_seq_left$' was re-initialized from 3. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'omitseq$' was re-initialized from 0. to 1.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'sub_seq_typ$' was re-initialized from 0. to 1.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'bldnxtool$' was re-initialized from 0. to 1.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'nobrk$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'nobrkxz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'nobrkyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lnobrk$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lnobrkxz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lnobrkyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'arcoutput$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'arcoutputxz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'arcoutputyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'larcoutput$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'larctypexz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'larcoutputyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'breakarcs$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'breakarcsxz$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'breakarcsyz$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lbreakarcs$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lbreakarcsxz$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lbreakarcsyz$' was re-initialized from 0. to 2.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'do_full_arc$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'do_full_arcxz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'do_full_arcyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'ldo_full_arc$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'ldo_full_arcxz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'ldo_full_arcyz$' was re-initialized from 1. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'rotfeed4$' was re-initialized from 2. to 1.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'rotfeed5$' was re-initialized from 3. to 0.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'lrotfeed4$' was re-initialized from 2. to 1.

24 Aug 2010 12:41:35 PM - <2> - CONTROL DEFINITION - - Post variable 'sub_level$' was re-initialized from 0. to 0.

24 Aug 2010 12:41:35 PM - <2> - Successful completion of posting process!


Link to comment
Share on other sites

code:

pwcs            #G54+ coordinate setting at toolchange

 

sav_frc_wcs = force_wcs

if sub_level$, force_wcs = zero

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

[

[

if workofs$ < 6,

[

if workofs$ < 1, g_wcs = 55

else,

g_wcs = workofs$ + 54

]

if workofs$ > 6 & workofs$ < 26, g_wcs = workofs$ + 103

if workofs$ > 54, g_wcs = workofs$

]

[

*g_wcs

]

]

force_wcs = sav_frc_wcs

!workofs$

The way this is set up a work offset of 0 (-1) or 1 will = G55

 

if workofs$ < 1, g_wcs = 55# <<< work offset set at -1 or 0

 

else,

g_wcs = workofs$ + 54 #<<< work offset set at 1 + 54 = G55

Link to comment
Share on other sites

Tim,

 

the -1 is what is throwing your whole scheme off. -1 will never, ever occour. The -1 you see in the toolplane page will NEVER be written to the NCI.

 

The -1 tells mastercam to figure out what value to put in. So if you have one op with a 55 in it and one with a -1 then Mastercam will take the -1 and if the plane & origin is different than that plane used in the 55 toolpath then you would get a ZERO value written to the offset field causing a G55 based on your logic. If the toolplane and tool origin where the same then you would get the same 55 written out to the NCI as the first operation. only in the case of 2 toolpaths.

 

Now if there were 3 toolpaths and lets say the first op had a 55 in the workofset field and the other 2 were -1 and all 3 were different tool planes then the workoffset value written to the NCI would be 55, 0, 1 respectively for the 3 toolpaths and in all cases based on your logic they would all be G55 in the NCI file.

 

For you to get a G56 output the workoffset value in the toolpath would have to be a 2 and that would actually be the 3rd offset used.

 

Mixing the use of automatic offsets (-1) and specific like specifying a 55 is not the way to go. Pick one or the other and role with it. All mastercam's automatic numbering will start with 0 and increment by 1. in transform toolpaths you have some additional controls for starting number and increment but not in NON transform toolpaths.

 

I strongly urge you to contact your reseller for some training on Mastercam and offsets otherwise you will be chasing your post logic from here to kingdom come especially if you keep using the -1 in the toolpath.

 

 

The good news is there are no errors in your post according to the ERR file.

 

I've cleaned up the indenting on the postblock to make it more readable.

 

code:

pwcs            #G54+ coordinate setting at toolchange

 

sav_frc_wcs = force_wcs

if sub_level$, force_wcs = zero

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

[

[

if workofs$ < 6,

[

if workofs$ < 1, g_wcs = 55

else, g_wcs = workofs$ + 54

]

if workofs$ > 6 & workofs$ < 26, g_wcs = workofs$ + 103

if workofs$ > 54, g_wcs = workofs$

]

[

*g_wcs

]

]

force_wcs = sav_frc_wcs

!workofs$


Link to comment
Share on other sites

Colin,

 

I'm not sure the work offset functionality in Mastercam is covered in our posts docs but I will check.

 

i was going to tell you to use the Mastercam help until I opened it and read where it says

quote:

entering -1 in the offset field will result in no offset code being generated

, which is NOT true. eek.gif

 

The key to remember here is -1 ALWAYS tells mastercam to determine what value - offset to use. And by offset I don't mean based on your machine. It gets a little tricky but here are some things to help.

[*]-1 allows Mastercam to determine when and what offset value to use

[*]Offset numbering in Mastercam always starts from ZERO and increments by 1 ie 0,1,2,3,etc

[*]Mastercam offset values are controlled by change in plane (view) and/or tool origin

[*]When -1 is active, Mastercam uses the other other planes and operations already created to determine to use an exiting offset (matching plane) or create a new one

[*]When using -1 and a new offset is warranted (change in plane/origin) Mastercam will always start with the lowest available number. IE. IF you are entering a 55, 56, 57 for your offset values in the toolpath and you create another toolpath with a -1 and Mastercam determined it met requirements for new offset it would enter the next available value starting from ZERO and NOT from the highest number entered already.

[*]The actual value written to the NCI is just the an integer value (0,1,2,3,......100,101,102...etc)

[*]There is no way to control the Start numbering and increment in toolpaths - the only exception is using transform toolpaths

[*]When using transform toolpaths you must understand that when a copy of the operation is created the settings (off, maintain, start, increment) for work offset in the transform operation will be used, but off doesn't really mean off. The default work offset value for ALL operations is -1 and -1 is automatic numbering so it may still be possible for Mastercam to create a new offset.

[*]Transforms Maintain can cause new offsets if the source operatrions are set to -1, but if set to an actual value say 2 then maintain would make the trasnform copies 2 as well.

[*]Because there is no real off switch for offsets our posts use the Miscellaneous Integer #1 to determine if the user wants offset output or not.

[*]The post can be used and configured according to how you the user want to use the work offsets. For example entering in a value that more closely resemble the gcode on your machine... IE.54, 55... for G54 G55, 1, 2 for E1, E2, etc

[*]If you choose to enter values that resemble your actually G code numbering DO NOT try and mix it with the auto numbering.

[*]The offset numbering scheme is designed to allow the flexibility of going from machine to machine without having to edit your toolpaths. For example if you stick with the numbering scheme of 0,1,2,3,4. You can configured multiple posts for multiuple machines based on this generic scheme and get the correct output for your machine. for exmaple one post coudl output G54, G55, G56 and that same MCX file with no changes can outoput E1, E2, E3 if you use the standard offset numbering.

[*]A vlaue of 0 = first offset, 1=second offset, 2=3rd offset and so on.

I hope this helps and it looks like I need to follow-up with documentation to clear up all this confusion.

Link to comment
Share on other sites

quote:

quote:entering -1 in the offset field will result in no offset code being generated

 

, which is NOT true. [Eek!]

well i just learned something smile.gif

no wonder why i get auto offsets in my program when set to -1 which is not off like i thought

 

i always changed my offsets for all views to 0 in view manager to lock on one offset i dont use misc values for this so i can change the offset if needed

 

thanks again Jim

Link to comment
Share on other sites

Thanks Jim.

 

One major issue I see is the fact that changing the offset for a group of operations makes them all dirty and in need of regeneration. This is a huge PITA for me on an almost daily basis.

 

I fully understand the MasterCam offsets although I can't say I'm very happy with the base functionality of the automatic numbering. I think the user should have some control over customization of the offsets and the default configuration used.

 

I think CNC could make some HUGE improvements in the ease of use of the offsets. The whole reason for my original post was to try to make up for some of problems I run into as it relates to offsets. I understand the logic but all my machines use G value offsets. My VMC's use G55 as the first offset, lathes use G54. Let's find a way to make the software work better for the end user and not tied to some rigid archaic offset system. I was extremely turned off by Esprit's rigid almost self defeating work offset system, lets learn from that and move 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...