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:

Repeating questions


Recommended Posts

Hello everyone,
   I made the post asks question when I need to change work offset manually but it would ask every operation instead of one time only.  Is there away that we can only make it ask on the first time only?  Thank you for your time to respond, please help.

 

For example, if I have 100 operations, it would ask 100 times where as I would like it asks me only the first time then to change all work offset if my value is greater than "0".  Thank you.
 

UserOrigin    : 1 #=========> I called it from here
OriginNumber  : 0 #User manual input workoffset other than MasterCam given #=========> I called it from here

fmt  "G" 4  UserOrigin #=========> I called it from here

pwcs_g10_com  #Work Offset Comment for G10 lines

      if workofs2 < 6,
        #[
        #g_wcs = pofs2 + 53
        #*g_wcs
        #]
        
       q3 #=========> I called it from here
        [
         UserOrigin = OriginNumber #=========> I called it from here
         if OriginNumber < 6, g_wcs = workofs$ + 54 + UserOrigin, *g_wcs  #=========> I called it from here
        ]
        
       q3 #=========> I called it from here
        [        
         UserOrigin = OriginNumber #=========> I called it from here
         if OriginNumber > 5, p_wcs = UserOrigin - 5, "G54.1", *p_wcs #=========> I called it from here
        ]
        
      else,
        [
        if haas,
          [
          p_wcs = pofs2        #G154 P1 to P99
          "G154", *p_wcs
          #g_wcs = workofs$ + 104        #G110 to G129
          #*g_wcs  
          ]
        else,wcs_comm
          [
          p_wcs = pofs2
          "G54.1", *p_wcs
          ]
        ]

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, #ask Colin
          [
          if workofs$ < 6,
            [
             q3 #=========> I called it from here
             [
              UserOrigin = OriginNumber #=========> I called it from here
              if OriginNumber < 6, g_wcs = workofs$ + 54 + UserOrigin, *g_wcs, else, g_wcs = workofs$ + 54 #=========> I called it from here
             ]

             q3 #=========> I called it from here
              [
               UserOrigin = OriginNumber #=========> I called it from here
               if OriginNumber > 5, p_wcs = UserOrigin - 5, "G54.1", *p_wcs #=========> I called it from here
              ]
            
             #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$
        ]

Link to comment
Share on other sites
7 minutes ago, 5th Axis CGI said:

The Slippy slope I tried warning you about. Again why not use the built in functions in Mastercam to do exactly what you are trying to do with a question?

The one already built in is only treat as "TEXT" not a real value.  Is there away I can make it real value some like mine?  

 

thank you 5th Axis CGI for responding my question.

Link to comment
Share on other sites

Just a suggestion on how you can do that.

I use a param in the begining of program where I store the workoffset#, and keep recall it

If u use more then 2 wpc on your prg things gets a bit complicated but u can do it(use buffers) .

This way your guys can change on the fly what workoffset# they want to use, and you won't need to change ur MC file

Fanuc:
G20(INCH PROGRAM)
#531=58.(WPC USED) 
G90G10L2P0X0Y0Z0W0B0 
G90G10L2P5X-40.1815Y-22.0008Z-47.086W-5.B359.995 
G59G90G40G80G98G17
M301(RETRACT FOR TOOL CHANGE)
M01
 
(--------------------) 
N4T4(2" INS EM R0.06 FIN TC=6) 
M6(MAX=Z5.  MIN=Z2.7)
M01(FINISH WALLS LEFT-1-WEAR COMP/DIA2.) 
(EXTRA ON XY=0. / EXTRA ON Z=0.) 
G#531M200
G08P1
S800F30.M13
M08
M198P302 
M301
M01

Sinumerik:

$P_UIFR[1]=CTRANS(X,-299.18,Y,-299.555,Z,-493.57,A,0,C,178.702)

G700 ;G700=INCH / G710=METRIC PROGRAM

SMOOTHING_ON:  CYCLE832(.002,112001) ;High Speed settings ON

SMOOTHING_OFF: CYCLE832()

;

;----DATUM USED ----

DATUM: G54 D1

ENDLABEL: CYCLE800(1,"",10,39,,,,,,,,,,-1)

TCHANGE ;RETRACT FOR TOOL CHANGE)

;

;***RESTART OPTION***

GOTOF "SEQUENCE"<<R1  ;(JUMP)

;

 

;**************

SEQUENCE1: G700 ;MSG("--- 2" INS E/M ---")

CANCEL_ALL

T1 M06  ;MAX 4. / MIN -.06

RETRACT ;RETRACT Z

M50

LOAD_RPM_T1: S770 F72. M3

ENDLABEL: M8

;GOTOF "SEQUENCE1_"<<R2  ;(SUB_JUMP)

;-----------

SEQUENCE1_1:  REPEATB DATUM ;SET ACTIVE WPC

CYCLE800(1,"",10,39,,,,180.,90.,,,,,-1)

;-----------

MSG("FACE BACK-WEAR COMP/DIA2.")

; EXTRA ON XY=0. EXTRA ON Z=.005

G90 G0 X-5.7466 Y1.45

.............

RETRACT ;RETRACT Z

 

MSG("SIDES-WEAR COMP/DIA2.")

; EXTRA ON XY=.005 EXTRA ON Z=0.

;-----------

SEQUENCE1_3:  REPEAT DATUM

;-----------

REPEATB LOAD_RPM_T1

G90 G0 X-4.17 Y-2.89

 

  • Like 1
Link to comment
Share on other sites
29 minutes ago, Grievous74 said:

Just a suggestion on how you can do that.

I use a param in the begining of program where I store the workoffset#, and keep recall it

If u use more then 2 wpc on your prg things gets a bit complicated but u can do it(use buffers) .

This way your guys can change on the fly what workoffset# they want to use, and you won't need to change ur MC file


Fanuc:
G20(INCH PROGRAM)
#531=58.(WPC USED) 
G90G10L2P0X0Y0Z0W0B0 
G90G10L2P5X-40.1815Y-22.0008Z-47.086W-5.B359.995 
G59G90G40G80G98G17
M301(RETRACT FOR TOOL CHANGE)
M01
 
(--------------------) 
N4T4(2" INS EM R0.06 FIN TC=6) 
M6(MAX=Z5.  MIN=Z2.7)
M01(FINISH WALLS LEFT-1-WEAR COMP/DIA2.) 
(EXTRA ON XY=0. / EXTRA ON Z=0.) 
G#531M200
G08P1
S800F30.M13
M08
M198P302 
M301
M01

Sinumerik:

$P_UIFR[1]=CTRANS(X,-299.18,Y,-299.555,Z,-493.57,A,0,C,178.702)

G700 ;G700=INCH / G710=METRIC PROGRAM

SMOOTHING_ON:  CYCLE832(.002,112001) ;High Speed settings ON

SMOOTHING_OFF: CYCLE832()

;

;----DATUM USED ----

DATUM: G54 D1

ENDLABEL: CYCLE800(1,"",10,39,,,,,,,,,,-1)

TCHANGE ;RETRACT FOR TOOL CHANGE)

;

;***RESTART OPTION***

GOTOF "SEQUENCE"<<R1  ;(JUMP)

;

 

;**************

SEQUENCE1: G700 ;MSG("--- 2" INS E/M ---")

CANCEL_ALL

T1 M06  ;MAX 4. / MIN -.06

RETRACT ;RETRACT Z

M50

LOAD_RPM_T1: S770 F72. M3

ENDLABEL: M8

;GOTOF "SEQUENCE1_"<<R2  ;(SUB_JUMP)

;-----------

SEQUENCE1_1:  REPEATB DATUM ;SET ACTIVE WPC

CYCLE800(1,"",10,39,,,,180.,90.,,,,,-1)

;-----------

MSG("FACE BACK-WEAR COMP/DIA2.")

; EXTRA ON XY=0. EXTRA ON Z=.005

G90 G0 X-5.7466 Y1.45

.............

RETRACT ;RETRACT Z

 

MSG("SIDES-WEAR COMP/DIA2.")

; EXTRA ON XY=.005 EXTRA ON Z=0.

;-----------

SEQUENCE1_3:  REPEAT DATUM

;-----------

REPEATB LOAD_RPM_T1

G90 G0 X-4.17 Y-2.89

 

Thank you, I'll start working on it.  Once again, thank you.

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