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 force to appear at ...


Recommended Posts

Hello everyone,
  I am trying to make the work offset to appear at the "no tool change section".  I think somehow the PWCS does need something to triggered the WORK OFFSET.  I also tried "*G_WCS" and it worked but the operation work offset is pushed to G56 instead of G55.  I would like to use the PWCS instead of *G_WCS ...  Please see codes below and thank you, have a great holiday.

 

 

 

 

===== Defined as... =====

ptlchg_com      #Tool change common blocks  
  if not(index), # WORK OFFSET HERE SECOND B HERE
    pbld, no_spc$, [if prv_sgabsinc, *sgabsinc], pwcs, e$  #
ptlchg0$         #Call from NCI null tool change (tool number repeats)
        pbld, no_spc$, *sg00, *sg90, pwcs, "Z5.(PROGRAM JUMPS HERE)", e$ # Not show WORK OFFSET HERE..., would like 2nd offset shows here


============ G-Code ========

%
O1000(T.NC)
(*)
N1( 3.0000, 3" SHM 90DEG EXL, CB, FINISHER,)
(3FLTS .750LOC, 13.00STO)
G0 G17 G40 G49 G80 G90
G91 G28 Z0 M19
/G28 Y0.(TOOLPATH LENGTH= .06 MIN.)
M8
T1 M6(2D - CONTOUR, CUT#1)
G90 G54 S3000 M3     =========================> G54, it's good (pwcs)
X-9.301 Y-2.6442
G43 H1 Z1. (DOC= Z0.)
Z.0625
G1 Z0. F6.36
(*****)
G1 X3.2796 Y-5.9577
G0 Z1.
(*)
N102(2D - CONTOUR, CUT#2)
G0 G90 Z5.(PROGRAM JUMPS HERE)  =========================> G54, should appear here.... (pwcs),  G0 G90 G54 Z5.(PROGRAM JUMPS HERE)  
X-9.301 Y-2.6442
S2000 M3(10X ROUGH MULTI-PASSES, .5 EACH)
G43 H1 Z1.(DOC= Z0.)
Z.0625
G1 Z0. F50.
(*****)
G1 X3.2796 Y-5.9577
G0 Z1.
(*)
N103(2D - CONTOUR, CUT#3)
G0 G90 G55 Z5.(PROGRAM JUMPS HERE) =========================> G54, it's good (pwcs)
X-9.301 Y-2.6442(10X ROUGH MULTI-PASSES, .5 EACH)
G43 H1 Z1.(DOC= Z0.)
Z.0625
G1 Z0. F50.
(*****)
G1 X3.2796 Y-5.9577
G0 Z1.
M9
G91 G28 Z0. M5
G28 Y0. M5
M30
%
(6,203CHARS - 6.22KB)

Link to comment
Share on other sites

The key is in the pwcs postblock, ....how is it constructed, I  have seen many different versions.....

Also check switches at top of post, I have seen switches to increment the wcs

Have also seen a wcs called only once at start of file somewhere

 

  • Like 1
Link to comment
Share on other sites
On 5/29/2018 at 5:49 AM, nickbe10 said:

The key is in the pwcs postblock, ....how is it constructed, I  have seen many different versions.....

Also check switches at top of post, I have seen switches to increment the wcs

Have also seen a wcs called only once at start of file somewhere

 

Hi Nickbe10,
   You have opened my eyes, it is tied  to FORCE_WCS....  This is what I've done...  And... THANK YOU for your BIG help....

 

# --------------------------------------------------------------------------
# General Output Settings
# --------------------------------------------------------------------------
force_wcs   : yes$  #Force WCS output at every toolchange?  ======================= must be "YES$"
#EndRegion General output settings

 

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, # | wcs_comm, ====> Turn off this line
	if force_wcs, ===================> replace it with this line
          [
          if workofs$ < 6,
            [
             [
              if UserOrigin > 0 & UserOrigin < 6,
              UserOrigin = OriginNumber
              if OriginNumber < 6, g_wcs = workofs$ + 54 + UserOrigin, *g_wcs, else, g_wcs = workofs$ + 54
             ]

              [
              if UserOrigin > 5,
               UserOrigin = OriginNumber
               if OriginNumber > 5, p_wcs = UserOrigin - 5, "G54.1", *p_wcs
              ]

             #if mr1$ < 5, g_wcs = workofs$ + 54
             #if mr1$ < 5, *g_wcs
             #if mr1$ = 5, f_wcs = workofs$ + 1
             #if mr1$ = 5, *f_wcs
            ]
          else,
            [
            if haas,
              [
              p_wcs = workofs$ - five        #G154 P1 to P99
              "G154", *p_wcs
              #g_wcs = workofs$ + 104        #G110 to G129
              #*g_wcs  
              ]
            else,
              [
              p_wcs = workofs$ - five
              "G54.1", *p_wcs
              ]
            ]
          ]
        force_wcs = sav_frc_wcs
        !workofs$
        ]
#EndRegion pwcs
Link to comment
Share on other sites
19 hours ago, PcRobotic said:

if UserOrigin > 0 & UserOrigin < 6, UserOrigin = OriginNumber

Just for completeness, how did you initialize and format these new variables. Looks like they must somehow be linked to workofs$.....

  • Like 1
Link to comment
Share on other sites
On 6/1/2018 at 10:53 AM, nickbe10 said:

Just for completeness, how did you initialize and format these new variables. Looks like they must somehow be linked to workofs$.....

Oh, this is I asked for "if USER wants to alter work offset before posting", see image.  It will automatically goes to PWCS add up the number so it cannot be conflicted the other work offsets.  Like 

 

Default is G54 and you want G56 then it would ensure all the work offsets are G56 and up even if you are doing sub programming...

Untitled.png

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