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:

mpmaster g10 output!


Recommended Posts

ok, that's pretty straight forward, I'll put it on my list but it won't be any time soon.

 

I see you are putting B values in your G10 work offset list. Doesn't this cause problems if your outputing angle values in the code, I typically otuput B0. in the G10 list which can be edited, but edited to "tweak" the output code plus or minus a small angle value to account for the fixturing. Just wondering how your machine handles it.

 

The machines handle it fine. Normally when we program originally, those will all be B0., but if they need to put a part on a different side of the tombstone, it's easier and safer to only have to change it in one spot.

Link to comment
Share on other sites
  • 2 weeks later...

Basically, something like this:

 

(WORK OFFSETS) 
G90G10L2P1(G54)X-2.5034Y-13.7655Z7.68B0. 
G90G10L2P4(G57)X-2.5034Y-12.2655Z7.6857B0.(B0) 
G90G10L2P5(G58)X-7.6857Y-12.2655Z-2.5034B90.(B90)
G90G10L2P6(G59)X7.6857Y-12.2655Z2.5034B270.(B270)
(CUTTER COMPS) 
G90G10L12P90R0.(TOOL - 40) 
G90G10L12P92R0.(TOOL - 42) 
G90G10L12P93R0.(TOOL - 43) 
G90G10L12P97R0.(T43-.4 DIA)
G90G10L12P94R0.(TOOL - 44) 
G90G10L12P95R.0015(TOOL - 45)
G90G10L12P96R0.(TOOL - 46) 

 

 

Also, is there a way to implement the work offset #'s like I have in the code above? Like where the P1 line has *(G54)* before it lists the XYZ coordinates?

Link to comment
Share on other sites

Yes, pretty easily.

Just insert the

"(", *pwcs, ")", before the tox statements like mine below:

 

if workofs6 < 6, 
	[
	pofs6 = pofs6 + 6
	pbld, n$, *sgabsinc, "G10", "L2", *pofs6, "(", *pwcs, ")", *tox3, *toy3, *toz3, "B0",
   	"(", *cabs6, ")" e$  #Offsets G54 - G59
	]  
           	else, pbld, n$, *sgabsinc, "G10", "L20", *pofs6, "(", *pwcs, ")", *tox3, *toy3, *toz3, "B0", "(", *cabs6, ")", e$
   	#Extended offsets g54.1 P1 - P48 
         	]

Link to comment
Share on other sites

Robert - where is it reading that # from? I just tried that and it had the same # on all the offset lines.

 

 

Also, I was just about to ask about extended offsets...I see some of what you have for that...what else needs to be done for that to work?

Link to comment
Share on other sites

Try this:

make sure to format pwcs6 as:

fmt P 4 pwcs6 #Buffer 6

in your formatting variable area

 if workofs6 < 6, 
               	pwcs6 = workofs6 + 54     	

	[
	pofs6 = pofs6 + 6
	pbld, n$, *sgabsinc, "G10", "L2", *pofs6, "(", pwcs6, ")",*tox3, *toy3, *toz3, "B0",
   	"(", *cabs6, ")" e$  #Offsets G54 - G59
	]  
           	else, 
		[
		pwcs6 = workofs6 - five
		pbld, n$, *sgabsinc, "G10", "L20", "(", "G54.1", pwcs6, ")",*pofs6, *tox3, *toy3, *toz3, "B0", "(", *cabs6, ")", e$
   			#Extended offsets g54.1 P1 - P48
		] 

Link to comment
Share on other sites

I have a number of things that I am doing buffer and offset and tool list wise.

Mainly for sorting and swapping things on the fly. So I do some loading of the 6 variables from tox3, toy3 and toz3 values.

Just match up the logic to your variables....

If you have problems, post the code from your G10 postblock.

Probably the preloadwcs postblock.

Or, shoot me an email. Either or......

Link to comment
Share on other sites

This is almost straight from what Roger added earlier:

 

# --------------------------------------------------------------------------
# Buffer 9  Read / Write Routines - G10 coordinate list
# --------------------------------------------------------------------------
pwritbuf9 # Write the workoffset and origins to buffer 9 - called from pwrtt$
      #--------------- Initialize variables
      size9 = rbuf(9,0)
      rc9 = 1
      new_x = 0
      new_y = 0
      new_z = 0
      new_workofs = 0

      while rc9 <= size9, # Determine if current workoffset/origin is unique
       [
       b9_tox = rbuf(9,rc9)

       if b9_tox <> tox$, new_x = new_x + 1
       if b9_toy <> toy$, new_y = new_y + 1
       if b9_toz <> toz$, new_z = new_z + 1
       if b9_workofs <> workofs$, new_workofs = new_workofs + 1
       ]

      if new_x = size9 | new_y = size9 | new_z = size9 | new_workofs = size9, # If current workoffset/origin is unique, write to buffer 9
       [
       b9_tox = tox$
       b9_toy = toy$
       b9_toz = toz$
       b9_workofs = workofs$

       b9_tox = wbuf(9,wc9)
       ]

preadbuf9 # Write the G10 workoffset list - called from psof
      #------------------------------------------------------------------
      # Determine largest workofs output - b9_test = largest workofs used
      #------------------------------------------------------------------
      #--------------- Initialize variables
      size9 = rbuf(9,0)
      rc9 = 1
      wc9 = 1
      b9_test =  -1

      while rc9 <= size9,
       [
       b9_tox = rbuf(9,rc9)
       if b9_workofs > b9_test, b9_test = b9_workofs
       ]
      #------------------------------------------------------------------
      # Ouptut the G10 list in order
      #------------------------------------------------------------------
      #--------------- Initialize variables
      size9 = rbuf(9,0)
      rc9 = 1
      wc9 = 1
      idx9 = 0
      b9_tox = 0
      b9_toy = 0
      b9_toz = 0
      b9_workofs = 0

      while idx9 <= b9_test,
       [
       while rc9 <= size9,
        [
        b9_tox = rbuf(9,rc9)
        if b9_workofs = idx9,
         [
          p_wcs = b9_workofs + 1
          if use_g10 = 1,
           [
           n$, "G90", "G10", "L2", *p_wcs, *b9_tox, *b9_toy, *b9_toz, "B0.", e$
           ]
          if use_g10 = 2,
           [
           n$, "G90", "G10", "L2", *p_wcs, *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$
           ]
         ]
        ]
       idx9 = idx9 + 1
       rc9 = 1
       ]

Link to comment
Share on other sites

Make sure and have your post backed up.

Format the b9_pwcs in your fmt area like so:

 

fmt    4  b9_pwcs  #buffer 9 G54 P value

 

Replace this info that you pasted with the changes below.

Let me know what you see, As I cannot test just this snippet.

 

 

 

# --------------------------------------------------------------------------
# Buffer 9  Read / Write Routines - G10 coordinate list
# --------------------------------------------------------------------------
pwritbuf9 # Write the workoffset and origins to buffer 9 - called from pwrtt$
  	#--------------- Initialize variables
  	size9 = rbuf(9,0)
  	rc9 = 1
  	new_x = 0
  	new_y = 0
  	new_z = 0
  	new_workofs = 0

  	while rc9 <= size9, # Determine if current workoffset/origin is unique
   	[
   	b9_tox = rbuf(9,rc9)

   	if b9_tox <> tox$, new_x = new_x + 1
   	if b9_toy <> toy$, new_y = new_y + 1
   	if b9_toz <> toz$, new_z = new_z + 1
   	if b9_workofs <> workofs$, new_workofs = new_workofs + 1
   	]

  	if new_x = size9 | new_y = size9 | new_z = size9 | new_workofs = size9, # If current workoffset/origin is unique, write to buffer 9
   	[
   	b9_tox = tox$
   	b9_toy = toy$
   	b9_toz = toz$
   	b9_workofs = workofs$

   	b9_tox = wbuf(9,wc9)
   	]

preadbuf9 # Write the G10 workoffset list - called from psof
  	#------------------------------------------------------------------
  	# Determine largest workofs output - b9_test = largest workofs used
  	#------------------------------------------------------------------
  	#--------------- Initialize variables
  	size9 = rbuf(9,0)
  	rc9 = 1
  	wc9 = 1
  	b9_test =  -1

  	while rc9 <= size9,
   	[
   	b9_tox = rbuf(9,rc9)
   	if b9_workofs > b9_test, b9_test = b9_workofs
   	]
  	#------------------------------------------------------------------
  	# Ouptut the G10 list in order
  	#------------------------------------------------------------------
  	#--------------- Initialize variables
  	size9 = rbuf(9,0)
  	rc9 = 1
  	wc9 = 1
  	idx9 = 0
  	b9_tox = 0
  	b9_toy = 0
  	b9_toz = 0
  	b9_workofs = 0

  	while idx9 <= b9_test,
   	[
   	while rc9 <= size9,
		[
		b9_tox = rbuf(9,rc9)
		if b9_workofs = idx9,
     	[
  		p_wcs = b9_workofs + 1
  		if b9_workofs < 6,
   	[
   	b9_pwcs = p_wcs + 54
  		if use_g10 = 1,
       	[
       	n$, "G90", "G10", "L2", *p_wcs, "(,"(", "G5", b9_pwcs, ")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$
       	]
  		if use_g10 = 2,
       	[
       	n$, "G90", "G10", "L2", *p_wcs, "(", "G5", b9_pwcs, ")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$
       	]
      		]
      		else,
                   	[
                   	b9_pwcs = p_wcs - 5
                   	if use_g10 = 1,
       	[
       	n$, "G90", "G10", "L20", *p_wcs, "(, "(", "G54.1 P", b9_pwcs, ")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$
       	]
  		if use_g10 = 2,
       	[
       	n$, "G90", "G10", "L20", *p_wcs, "(, "(", "G54.1 P", b9_pwcs, ")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$
       	]
              		]
     	]
		]
   	idx9 = idx9 + 1
   	rc9 = 1
   	]

Link to comment
Share on other sites

I've got it to this point:

 

N130 G90 G10 L2 P1 ( G54 ) X-.495 Y-10.8676 Z7.415 B0.
N140 G90 G10 L2 P2 ( G55 ) X-7.415 Y-10.8676 Z.405 B0.
N150 G90 G10 L2 P3 ( G56 ) X7.415 Y-10.8676 Z.495 B0.
N160 G90 G10 L2 P4 ( G57 ) X0. Y-2.9676 Z5.75 B0.
N170 G90 G10 L2 P5 ( G58 ) X-.495 Y-2.0676 Z5.1875 B0.
N180 G90 G10 L2 P6 ( G59 ) X-5.1875 Y-2.0676 Z.405 B0.
N190 G90 G10 L20 P7 ( G54.1 P1 ) X5.1875 Y-2.0676 Z.495 B0.
N200 G90 G10 L20 P8 ( G54.1 P2 ) X-5.1875 Y-11.2126 Z2.393 B0.
N210 G90 G10 L20 P9 ( G54.1 P3 ) X5.1875 Y-11.2126 Z2.607 B0.
N220 G90 G10 L20 P10 ( G54.1 P4 ) X0. Y-11.2126 Z0. B0.

 

I can't figure out to change the extended offsets(L20) to match P numbers.

Link to comment
Share on other sites

Starting at the b9_pwcs line, I had to make the following changes:

 

 

b9_pwcs = p_wcs + 53
               if use_g10 = 1, 
               [ 
               n$, "G90", "G10", "L2", *p_wcs, "(""G",b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$  
               ] 
               if use_g10 = 2, 
               [ 
               n$, "G90", "G10", "L2", *p_wcs, "(""G",b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$ 
               ] 
               ] 
               else, 
                       [ 
                       b9_pwcs = p_wcs - 6 
                       if use_g10 = 1, 
               [ 
               n$, "G90", "G10", "L20", *p_wcs, "(""G54.1 P",b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$ 
               ] 
               if use_g10 = 2, 
               [ 
               n$, "G90", "G10", "L20", *p_wcs, "(""G54.1 P",b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$ 
               ] 
                       ] 
       ] 
               ] 
       idx9 = idx9 + 1 
       rc9 = 1 
       ]

Link to comment
Share on other sites

This should take care of the L20 Px values....

 

 


else, 
                   	[ 
                   	b9_pwcs = p_wcs - 6 
                   	if use_g10 = 1, 
           	[ 
           	n$, "G90", "G10", "L20 P", *b9_pwcs, "(""G54.1 P",*b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$ 
           	] 
           	if use_g10 = 2, 
           	[ 
           	n$, "G90", "G10", "L20 P", *b9_pwcs, "(""G54.1 P", *b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$ 
           	] 
                   	] 

Link to comment
Share on other sites

Robert - that worked, with some slight modification:

 

else, 
                       [ 
                       b9_pwcs = p_wcs - 6 
                       if use_g10 = 1, 
               [ 
               n$, "G90", "G10", "L20", "P", *b9_pwcs, "(""G54.1 P",*b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, "B0.", e$ 
               ] 
               if use_g10 = 2, 
               [ 
               n$, "G90", "G10", "L20", "P", *b9_pwcs, "(""G54.1 P",*b9_pwcs,")", *b9_tox, *b9_toy, *b9_toz, *srot_label, no_spc$, "0", e$ 
               ] 
                       ] 
       ] 
               ] 
       idx9 = idx9 + 1 
       rc9 = 1 
       ]

 

 

Thanks for the help.

  • Like 1
Link to comment
Share on other sites

Robert-Spade

 

Do you know of any way to output the B axis datum on G10 line instead of "B0" as i tend to leave all my B moves in prog to zero

and let the G10 line control the rest of prog!

 

Cheers Jason.

I used to do it that way long ago, but it entailed manually editing the nc code. Throughout the years I've learned that the less manual editing you do, the better.

 

Other than the cutter comp issue that I mentioned to Roger ealier in this thread, I'm pretty much there.

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