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:

haas #[2400+


Recommended Posts

how to get post to output #[2400+tool num.=0 for every tool after tool list or no matter when..needed to automatically zero tools diameter in offset table.see example of what i need

 

(-----------TOOLS-----------)

(-------------------------------)

(N11 T23-HM50-------------)

(N13 T9-RISUK 10----------)

(N14 T10-FINISH 10--------)

(N15 T6-DRILL 5------------)

(N16 T15-FAZA 90° D6----)

(N17 T22-BALL 1.5X6------)

(--------------------------------)

(-------- MIN Z..-17.---------)

(--------------------------------)

(TOTAL TIME:00:02:24----)

(---------------------------------)

#[2400+23]=0

#[2400+9]=0

#[2400+10]=0

#[2400+6]=0

#[2400+15]=0

#[2400+22]=0

Link to comment
Share on other sites

What am I doing wrong?

And now where I need to write buffer (ptooloff)

after tooltable ?

 

toolffsets

string2 = "#[ 2400 + ", tldia$,"] = 0", e$

string2 = wbuf (2, wc2)

 

 

ptooloff

pbld, "(==== OFFSET ====)", e$

size2 = rbuf (2, 0)

rc2 = 1

while rc2 <= size2,

[

string2 = rbuf (2, rc2)

pbld, *string2, e$

]

Link to comment
Share on other sites

fbuf 2 0 80 0 1 #Buffer 1

In buffer def, change 80 to 255 (for strings in new posts)

 

 

 

toolffsets

string2 = "#[ 2400 + ", tldia$,"] = 0", e$

string2 = wbuf (2, wc2)

It's OK, but a postblock have to be started with "p" so: ptoolffsets

When you pass a value to a string, you don't need to EOB char, so remove ", e$"

Well, change the whole line because of "+":) (you have to add strings together)

string2 = "#[ 2400 + " + tldia$ + "] = 0"

 

 

 

And make sure that your buffer is filled up!

I would make some similar stuff:

pwrtt$		  #Pre-read NCI file
  if tool_info > 1 & t$ > 0 & gcode$ <> 1003,
  [
     ptooltable
     ptoolffsets
     ]

Link to comment
Share on other sites

I made a mistake here... I guess your tldia$ value is not formatted (fmt....) so its a numeric value and you have to convert it to string

So: string2 = "#[ 2400 + " + no2str(tldia$) + "] = 0"

I only see it :help:

(==== TOOL LIST ====)

(T271 = 75 FACE MILL)

(==== OFFSET ====)

(T219 = 10. FLAT ENDMILL)

(==== OFFSET ====)

(T213 = 4. FLAT ENDMILL)

(==== OFFSET ====)

 

 

and i write

 

 

pwrtt$ #Pre-read NCI file

if tool_info > 1 & t$ > 0 & gcode$ <> 1003,

[

ptooltable

ptooloff <---------------

]

Link to comment
Share on other sites

Yes it works great ! :thumbsup:

I am interested why 255 and not 80?

And I'm interested in how he writes and reads as buffer

 

Glad to help and hear it! ;) (Now you can dona.... :D :D :D)

 

255, because MP language and (MP.dll) has changed, the portfolio what I linked, that's a little bit old.

But except this, very informative and clear.

Now a string buffer can store 255 characters. (may work with 80, but...)

 

How do you mean how read/writes the buffer?

 

In this example we know that we need to write a line into our buffer @ every toolchange and at pre-read NCI file.

Pre-read, because we would output data's in the beginnig of NC code.

That's why I put the write postblock call into pwrtt$ postblock.

  • Like 1
Link to comment
Share on other sites

Peter, this has been one of my biggest issues for some time. Still fighting certain posts and tool tables have to just see what is going to break free. Once I can wrap my brain around the buffers then I might finally get it all done. Buffers are still puzzling to me even after seeing all your examples and reading all of your provided information I still do not get the calling and the using and then the output to be correct, I keep seeing decrease in my output in the tool table. I think it is coming from the rc1 = wc1 - one line in the post and since the buffer automatically adds 1 to items I think the addition and subtraction are throwing things in a tail spin.

 

Right here is what I am talking about:

 

[size=4]plast_recd	 #Update the last record(s) for min-max and point[/size]
 rc1 = wc1 - one [b] <---- Once used[/b]
 c1_gcode = rbuf (one, rc1)
 if prv_opcode$ <> 104,
	[
	c1_x_min = x_min$
	c1_x_max = x_max$
	]
 rc1 = wc1 - one			 #rc1 is used to write also [b]<--- Then Again why??????????????[/b]
[size=4]	 c1_gcode = wbuf (one, rc1)[/size]

 

The reason I question this is because of the use of rc1 in the pwrtt$ section of the post.

pwrtt$		 #Buffer toolchange information, tooltable = 3 calls on 1003
 if gcode$ = 1001, psetup
 pcut_cctyp
 if opcode$=104 | opcode$=105 | opcode$=three | opcode$=16, cc_pos$ = zero
 if gcode$ <> 1001, plast_recd
 pcur_recd
 if gcode$ <> 1003, cc_pos$ = zero
 !opcode$, !tool_op$
 if gcode$ = 1003,
 [
 size1 = rbuf (one, zero)
 rc1 = one
 if rc1 < size1, preadcur_nxt
 if cc_1013$ = zero, cc_pos$ = zero
 ]

 

When I post I get this kind of output in my tool table:

 

(T0101 - N1 - OD 55 ROUGH		 - OFFSET - 1 - INSERT - DNMG-432 - HOLDER - MDJNL-164C)
(T0909 - N9 - OD 55 FINISH		 - OFFSET - 9 - INSERT - DNMG-431 - HOLDER - MDJNL-164C)
(T1010 - N10 - CENTER DRILL- .25 DIA. - OFFSET - 10 - INSERT - NONE - HOLDER - NONE)
(T0404 - N4 - 1/4 SPOTDRILL	 - DIA. - .25")
(T0505 - N5 - 1/8 FLAT EM		 - OFFSET - 5 - DIA. - .125")
(T0486 - N5 - 1/8 FLAT EM		 - OFFSET - 14 - DIA. - .125")
(T0485 - N5 - 1/8 FLAT EM		 - OFFSET - 15 - DIA. - .125")
(T0484 - N5 - 1/8 FLAT EM		 - OFFSET - 16 - DIA. - .125")
(T0475 - N5 - 1/8 FLAT EM		 - OFFSET - 25 - DIA. - .125")
(T1212 - N12 - 3/32 FLAT ENDMILL - OFFSET - 12 - DIA. - .09375")
(T0600 - N6 - M4-0.7 STI TAP RH - DIA. - .191")
(T0808 - N8 - 1/4 CHAMFER MILL	 - OFFSET - 8 - DIA. - .25")
(T0099 - N1 - OD 55 ROUGH		 - OFFSET - 1 - INSERT - DNMG-432 - HOLDER - MDJNL-164C)
(T0891 - N9 - OD 55 FINISH		 - OFFSET - 9 - INSERT - DNMG-431 - HOLDER - MDJNL-164C)
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T1100 - N11 - 1/4 FLAT ENDMILL - DIA. - .25")
(T1089 - N11 - 1/4 FLAT ENDMILL - OFFSET - 11 - DIA. - .25")
(T0202 - N2 - 1/4 CHAMFERMILL	 - OFFSET - 2 - DIA. - .0001")

 

I cannot get my FANUC Tool Number to come out correct. I can get the N Number process to come out correct. I can get the Offset number to come out correct and I can post out correctly at each operation, but in the tooltable I keep getting math error of subtracting the tool number and the offset number from the record to give me bad output.

Link to comment
Share on other sites

I cannot get my FANUC Tool Number to come out correct. I can get the N Number process to come out correct. I can get the Offset number to come out correct and I can post out correctly at each operation, but in the tooltable I keep getting math error of subtracting the tool number and the offset number from the record to give me bad output.

 

Hi Crazy! :)

(Ron, am I right? :blushing: )

 

I just took a quick look into your snippets.

If you got the right N number in tooltable, you can go on a "rough" way, just simply make equal N and T at output.

But yes, you're right, it's not the real answer.

If you can share the write/read postblock here, it might be get us closer what/when cause this issue. Until this, I'll be the

second who confused about this "rc1 = wc1 - one" stuff :) Honestly ;)

 

For debugging (and understanding too) I can give you a good advice. (May be you know it, but I have to write here) ;)

If you switch on the keep flag in buffer definitinon (set second number to 1) then you got a file which represents the actual

buffer file.

See second 1 in definiton of Buffer-1 (with 12 number)

fbuf 1 1 12 0 0

 

At the same time (and in the next line for example) set filename and path for buff-1:

sbufname1$ = "D:\MyBufferFileForDeBuggggy.txt"

After first postprocess you have this file and you can keep open in your editor and it gives you a kind of visual feedback

from current buffer. It helps a lot, believe me ;)

 

 

I think it is coming from the rc1 = wc1 - one line in the post and since the buffer automatically adds 1 to items I think the addition and subtraction are throwing things in a tail spin.

Yes, you're right, at every read/write event, the counters are incremented by one. You always have to keep in mind that.

 

I see your tooltable. Do you want to output a line at every Operation in order? Or what is what you would like to see there?

May be I have some idea and easier to help then. ;)

Link to comment
Share on other sites

Ron/Peter,

 

When using buffer files, the read/write counter variables get incremented automatically when a buffer record is written or read. This can be really confusing, especially when trying to add your own increment/decrement scheme to the post logic. (I believe you mentioned throwing things in a tail spin?)

 

To stop that behavior, you can set 'buf_no_index$' to '1' or 'yes$' in the top of your post. This stops MP from automatically incrementing your counter variables, and lets you control the process yourself.

 

Hope that helps,

 

Colin

Link to comment
Share on other sites

Peter, here is more to look at.

 

pwrtt$		 #Buffer toolchange information, tooltable = 3 calls on 1003
 if gcode$ = 1001, psetup
 pcut_cctyp
 if opcode$=104 | opcode$=105 | opcode$=three | opcode$=16, cc_pos$ = zero
 if gcode$ <> 1001, plast_recd
 pcur_recd
 if gcode$ <> 1003, cc_pos$ = zero
 !opcode$, !tool_op$
 if gcode$ = 1003,
 [
 size1 = rbuf (one, zero)
 rc1 = one
 if rc1 < size1, preadcur_nxt
 if cc_1013$ = zero, cc_pos$ = zero
 ]
 #if you want repetitive tool output, keep the abs( ) in ptooltable and remove the >= t$ from the pwrtt call to this block	
 #if (tool_info = 2 | tool_info = 3) & gcode$ <> 1003 & op_id$ <> last_op_id & last_tloffno <> tloffno$ & t$ >= 0, ptooltable
 if (tool_info = 2 | tool_info = 3) & gcode$ <> 1003 & op_id$ <> last_op_id & last_tloffno <> tloffno$, ptooltable #This allows us to see the same tool with different offset
 last_tloffno = tloffno$ #This controls the different offset tracking not to duplicate it when they are used in the operations
 last_op_id = op_id$
 last_t = t$ #Trying to save the tool to keep subtraction from happening in the tool list when the same tool is called
ptooltable # Write tool table, scans entire file, null tools are negative
	 #if you want repetitive tool output, keep the abs( ) in ptooltable and remove the >= t$ from the pwrtt call to this block
	 toolno = t$ * 100 + tloffno$
	 tnote = abs(toolno) #use to be this abs(t$), but we want it to look different so we changed
	 tldianote = abs(tldia$) #Oct-20-08 AEH
	 [if spindle_no$ = 0, ntooltrack = t$],[if spindle_no$ = 1, ntooltrack = t$ + 1000]
	 ntooltrack = abs(ntooltrack) #See it used else where Figure why not
	 if opcode$ = 3 | opcode$ = 16, toffnote = tlngno$
	 else, toffnote = tloffno$
	 stinsert2 = ucase(stinsert2)
	 !spaces$
	 spaces$ = zero
	 if posttype$ = 2, #lathe tools
		 [
		 scomm_str, *tnote, " - ", *ntooltrack, " - ", plistcomm, " - ", *toffnote, pdspace, " - ", *stinsert, *stinsert2, " - ", *stholder, *stholder2, scomm_end, e$
		 #scomm_str, *tnote, ptspace, " - ", *toffnote, pdspace, " - ", *stinsert, *stinsert2, " - ", *stholder, *stholder2, scomm_end, e$
		 ]
	 else,				 #mill tools
		 [
		 if opcode$ = 3 | opcode$ = 16,
		 [
		 if tcr$ = 0, scomm_str, *tnote, " - ", *ntooltrack, " - ", plistcomm, " - ", *tldianote, punit, pdiamspc, scomm_end, e$
		 ]
		 else,
		 [
		 if tcr$ > 0, scomm_str, *tnote, " - ", *ntooltrack, " - ", plistcomm, " - ", *toffnote, pdspace, " - ", *tldianote, punit, pdiamspc, " - ", *tcr$, punit, scomm_end, e$
		 if tcr$ = 0, scomm_str, *tnote, " - ", *ntooltrack, " - ", plistcomm, " - ", *toffnote, pdspace, " - ", *tldianote, punit, pdiamspc, scomm_end, e$
		 ]
		 ]
	 spaces$ = prv_spaces$

 

I got all my tool change calls worked out perfectly which is really bugging me since it has to be the buffer freaking out and doing it through add-subtract process that goes against any logical process since everything else is using the same stuff, but outside of the buffer calls.

 


ptoolcomment    #Comment for tool
     if tool_info = 1 | tool_info = 3,
       [
       tnotelist = abs(t$) 
       toffnote = tloffno$
       strtool$ = ucase(strtool$)
       stinsert2 = ucase(stinsert2)
       !spaces$
       spaces$ = zero
       scomm_str, *tnotelist, " ", *toffnote, scomm_end, e$
       if posttype$ = two, # Lathe toolpath operation
         [
         if tool_op$ = 64, # Drill operation
         scomm_str, *strtool$, scomm_end, e$
         else,
         scomm_str, *strtool$, " ", *stinsert, *stinsert2, scomm_end, e$
         ]
       else, # Mill toolpath operation
       scomm_str, *strtool$, scomm_end, e$
       spaces$ = prv_spaces$
       ]


ltlchg$          #Toolchange, lathe
     toolchng = one
     gcode$ = zero
     copy_x = vequ(x$)
     pcc_capture   #Capture LCC ends, stop output RLCC
     c_rcc_setup$   #Save original in sav_xa and shift copy_x for LCC comp.
     pcom_moveb    #Get machine position, set inc. from c1_xh
     c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
     [if spindle_no$ = 0, ntooltrack = t$],[if spindle_no$ = 1, ntooltrack = t$ + 1000]
     *ntooltrack, ptoolcomment
     comment$
     if mr1$ > 0, pbld, n$, *mr1$, e$ #WAIT CODE CALLED FROM MISC REALS
     pbld, n$, "G0G18G40G80G97G99", e$
     pbld, n$, "G0G28U0", e$
     if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
     #if tool_op$ <> 65, pbld, n$, "G0G18G40G80G97G99", e$
     #if tool_op$ <> 65, pbld, n$, "G0G28U0", e$
     #if lturret$ = 1 | tool_op$ <> 65, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
     if mr3$ < 0 ,
         [
         [if spindle_no$ = 0, pbld, n$, *sg53,*mr3$],[if spindle_no$ = 1, pbld, n$, *sg53,*mr3$], e$ #Clearance is different on main and sub spindle
         ]
     else,
         [
         [if spindle_no$ = 0, pbld, n$, *sg53,"Z-8.5"],[if spindle_no$ = 1, pbld, n$, *sg53,"Z-7."], e$ #Clearance is different on main and sub spindle
         ]    
     toolno = t$ * 100 + tloffno$   
     if not(synch_flg & tool_op$ = 67),     #Suppress tool output if cutoff during part xfer
       [
       if omitseq$ = 1 & tseqno > 0,
         [
         pbld, [if home_type = -1, *sgcode], *toolno, e$
         ]
       else, pbld, n$, [if home_type = -1, *sgcode], *toolno, e$
       ]   
     if home_type < two, #Toolchange G50/home/reference position
       [
       sav_xh = vequ(copy_x)
       sav_absinc = absinc$
       absinc$ = zero
       start_xh = vequ(xh$)
       pmap_home   #Get home position, xabs
       ps_inc_calc #Set start position, not incremental
       #Toolchange home position
       if home_type = one,
         pbld, n$, *sgcode, pwcs, pfxout, pfyout, pfzout, e$
       else,
         [
         #Toolchange g50 position
         pbld, n$, *sg28ref, "U0.", e$
         if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
         if home_type = zero, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$
         ]
       pe_inc_calc #Update previous
       absinc$ = sav_absinc
       copy_x = vequ(sav_xh)
       ]
     else,
       [
       pbld, n$, *pwcs, e$
       ]
     ipr_actv$ = c1_ipr_actv
     pbld, n$, pfsgplane, pfsgfeed, e$
     pcaxis_off_l  #Postblock for lathe transition
     pcom_moveb    #Reset machine position, set inc. from last position
     pcan
     pspindle
     #Added for 'css_start_rpm' logic (09/05/01)
     if css_actv$,
       [
       if css_start_rpm,
         prpm # Direct RPM startup for programmed CSS
       else,
         pcssg50, pcss # NO RPM start - just output the CSS
       ]
     else, # Direct RPM was programmed
       [
       prpm # Output programmed RPM
       ]
     sav_absinc = absinc$
     if home_type > one, absinc$ = zero
     pcan1, pbld, n$, *sgcode, pfxout, pyout, pfzout, pscool, strcantext, e$
     if lcc_cc_pos, plcc_cc_pos  #Use sav_xa to position with comp. LCC
     pcom_movea    #Update previous, pcan2
     ps_inc_calc   #Reset current
     absinc$ = sav_absinc
     #Added for 'css_start_rpm' logic (09/05/01)
     if css_start_rpm,
       pcssg50, pcss # CSS output AFTER a G97S???? RPM spindle startup
     c_msng$        #Position single-tool sub, sets inc. current if G54...
     toolchng = zero
     plast
     sav_cc_st_seq = n$   #saved sequence number for canned cycles

mtlchg$          #Toolchange, mill
     toolchng = one
     gcode$ = zero
     copy_x = vequ(x$)
     pcom_moveb    #Get machine position, set inc. from c1_xh
     c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
     [if spindle_no$ = 0, ntooltrack = t$],[if spindle_no$ = 1, ntooltrack = t$ + 1000]
     *ntooltrack, ptoolcomment
     comment$
     if mr1$ > 0, pbld, n$, *mr1$, e$ #WAIT CODE CALLED FROM MISC REALS
     pbld, n$, "G0G18G40G80G97G99", e$
     pbld, n$, "G0G28U0", e$
     if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
     if mr3$ < 0,
         [
         [if spindle_no$ = 0, pbld, n$, *sg53,*mr3$],[if spindle_no$ = 1, pbld, n$, *sg53,*mr3$], e$ #Clearance is different on main and sub spindle
         ]
     else,
         [
         [if spindle_no$ = 0, pbld, n$, *sg53,"Z-8.5"],[if spindle_no$ = 1, pbld, n$, *sg53,"Z-7."], e$ #Clearance is different on main and sub spindle
         ] 
     if opcode$ = 3 | opcode$ = 16, toolno = t$ * 100 + tlngno$
     else, toolno = t$ * 100 + tloffno$
     if omitseq$ = 1 & tseqno > 0,
       [
       if tseqno = 2, n$ = t$
       pbld, n$, [if home_type = -1, *sgcode], *toolno, e$
       ]
     else, pbld, n$, [if home_type = -1, *sgcode], *toolno, e$ 
     if home_type < two, #Toolchange G50/home/reference position
       [
       sav_xh = vequ(copy_x)
       sav_absinc = absinc$
       absinc$ = zero
       start_xh = vequ(xh$)
       pmap_home   #Get home position, xabs
       ps_inc_calc #Set start position, not incremental
       #Toolchange home position
       if home_type = one,
         pbld, n$, *sgcode, pwcs, pfxout, pfyout, pfzout, e$
       else,
         [
         #Toolchange g50 position/reference
         pbld, n$, *sg28ref, "U0.", e$
         if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$
         if home_type = zero, pbld, n$, *sg50, pfxout, pfyout, pfzout, e$
         ]
       pe_inc_calc #Update previous
       absinc$ = sav_absinc
       copy_x = vequ(sav_xh)
       ]
     else,
       [
       pbld, n$, *pwcs, e$
       ]
     pbld, n$, pfsgplane, pfsgfeed, e$
     pcom_moveb    #Reset machine position, set inc. from last position
     pcaxis_on_m   #Postblock for mill transition
     pbld, n$, "G28H0", e$
     pcan
     sav_absinc = absinc$
     if home_type > one, absinc$ = zero
     pbld, n$, pclampoff, e$        # Unclamp      
     if millcc,
       [
       cabs = 0
       pbld, n$, *sgcode, pfcout, [if y_axis_mch, "Y0."], e$
       ]
     else,
       [
       prv_gcode$ = c9k                  #change modality for forced output
       pbld, n$, `sgcode, pfcout, e$     #` used in case indexing mode
       ]
     pindex
     pbld, n$, pclampbrake, e$  # Clamp      
     pcan1, pbld, n$, *sgcode, pfxout, pfyout, pfzout, strcantext, pspindle, prpm, e$
     pbld, n$, pscool, e$
     #pspindle
     #prpm
     pcom_movea    #Update previous, pcan2
     ps_inc_calc   #Reset current
     absinc$ = sav_absinc
     c_msng$        #Position single-tool sub, sets inc. current if G54...
     toolchng = zero
     if millcc, pmillccb #Set mill conversion
     plast

ltlchg0$         #Call from NCI null tool change, lathe
     toolchng0 = one
     copy_x = vequ(x$)
     start_xh = vequ(xh$)
     c_rcc_setup$   #Save original in sav_xa and shift copy_x for LCC comp.
     pcom_moveb    #Get machine position, set inc. from last position
     c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
     comment$
     pcan
     if tloffno$ <> last_tloffno, #added for these machines. If Force Tool change is used you get code machine will not run and sit.
         [
         if lturret$ = 1, pbld, n$, *sg00, *sg28, "U0", e$ #Lower Turret Does not need to go home to call different tooloffsets. 
         if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
         ] 
     toolno = t$ * 100 + tloffno$
     if home_type = -1,
       [
       prv_gcode$ = c9k
       pbld, n$, `sgcode, toolno, e$
       ]
     else, pbld, n$, toolno, e$
     pbld, n$, psgplane, e$
     pcaxis_off_l  #Postblock for lathe transition
     pspindle
     pnullspindle
     pbld, n$, pscool,e$
     force_flg = 0
     if not(g54g55) & home_type > one & workofs$ <> prv_workofs$, force_flg = 1
     if spindle_no$ <> last_spindle_no, force_flg = 1
     if tloffno$ <> last_tloffno, force_flg = 1 #We need to recall the X and Z axis Values when we move away from the last position
     if force_flg,
       [
       sav_absinc = absinc$
       absinc$ = zero
       pbld, n$, pwcs, e$
       pbld, n$, psgcode, pfxout, pfyout, pfzout, e$
       pe_inc_calc #Update previous
       ps_inc_calc #Set current inc.
       absinc$ = sav_absinc
       ]
     #Output cutter comp before each finish pass of           # 1/17/03
     #finishing groove canned cyle                            # 1/17/03
     if gcode$ = one, plinout                                 # 1/17/03
     else,                                                    # 1/17/03  
       [                                                      # 1/17/03        
       if lathecc = 3, pbld, n$, sccomp, e$                   # 1/17/03
       if tool_op$ = 201, !cc_pos$                            # 5/28/04
       prapidout                                              # 1/17/03 
       ]                                                      # 1/17/03
     if lcc_cc_pos, plcc_cc_pos  #Use sav_xa to position with comp. LCC
     pcom_movea
     c_msng$ #Single tool subprogram call
     toolchng0 = zero
     plast
     sav_cc_st_seq = n$   #saved sequence number for canned cycles

mtlchg0$         #Call from NCI null tool change, mill
     toolchng0 = one
     if last_millcc & op_id$ <> last_op_id & (not(millcc) | cuttype <> last_cuttype), pmillcca #End mill conversion
     copy_x = vequ(x$)
     start_xh = vequ(xh$)
     pcom_moveb    #Get machine position, set inc. from last position
     c_mmlt$        #Position multi-tool sub, sets inc. current if G54...
     comment$
     pcan
     if tloffno$ <> last_tloffno, #added for these machines. If Force Tool change is used you get code machine will not run and sit.
         [
         pbld, n$, *sg00, *sg28, "U0", e$
         if lturret$ = 1, pbld, n$, *sg28ref, "V0", e$ #Had to add Upper Turret Support for Y axis Home Call
         ]
     if opcode$ = 3 | opcode$ = 16, toolno = t$ * 100 + tlngno$
     else, toolno = t$ * 100 + tloffno$
     if home_type = -1,
       [
       prv_gcode$ = c9k                     #change modality for forced output
       pbld, n$, `sgcode, toolno, e$
       ]
     else, pbld, n$, toolno, e$
     pbld, n$, psgplane, e$
     #pcaxis_on_m   #Postblock for mill transition
     pspindle
     pnullspindle
     pbld, n$, pscool,e$
     force_flg = 0
     if not(g54g55) & home_type > one & workofs$ <> prv_workofs$, force_flg = 1
     if spindle_no$ <> last_spindle_no, force_flg = 1
     if tloffno$ <> last_tloffno, force_flg = 1
     if force_flg,
       [
       sav_absinc = absinc$
       absinc$ = zero
       pbld, n$, pwcs,e$
       pbld, n$, pclampoff, e$  # Clamp Off
       if millcc & not(last_millcc), pbld, n$, *sgcode, "C0.", [if y_axis_mch, "Y0."], e$
       else,
         [
         prv_gcode$ = c9k                     #change modality for forced output
         pbld, n$, `sgcode, pfcout, e$        #` used in case indexing mode
         ]
       pindex
       pbld, n$, pclampbrake, e$  # Clamp
       pbld, n$, psgcode, pfxout, pfyout, pfzout, e$
       pe_inc_calc #Update previous
       ps_inc_calc #Set current inc.
       absinc$ = sav_absinc
       ]
     else,
       [
       if op_id$ <> last_op_id & millcc & not(last_millcc),
         [
         pbld, n$, pclampoff, e$  # Clamp Off
         cabs = 0
         pbld, n$, *sgcode, pfcout, [if y_axis_mch, "Y0."], e$
         pbld, n$, pclampbrake, e$  # Clamp
         ]
       ]
     pbld, n$, pclampbrake0, e$
     pindex
     ppos_cax_lin  #Position C axis, toolplane or CL
     if millcc,
       [
       pmillccb #Set mill conversion
       pcom_moveb
       ]
     if gcode$ = one, plinout
     else, prapidout
     pbld, n$, pclampbrake, e$
     pcom_movea    #Update previous, pcan2
     c_msng$ #Single tool subprogram call
     toolchng0 = zero
     plast

plast       #Keep track of previous values
     last_millcc = millcc
     last_op_id =  op_id$
     last_cuttype  = cuttype
     last_spindle_no = spindle_no$
     last_mi4 = mi4$
     last_t = t$
     last_tloffno = tloffno$ #added for sending turret home when changing tooloffset numbers

 

My format statement for my defined variables and or added variables.

 

fmt "N" 24 ntooltrack #Sequence Number Process for N Tracking back to Tool Number on Fanuc Lathe

fmt "TOOL - " 4 tnotelist # Note format #Changed to support new tooltable process
fmt "T" 7 tnote # Changed to support TXXXX for Lathe output for Fanuc Machines

 

Great insight and if I ever get buffers figured out then I will finally think I get MP posts. By then they they will no longer exist, but atleast I will say I finally understood the process. That dump file is great that will be helpful.

Link to comment
Share on other sites

Colin that will be okay, but then it will throw everything else into a tailspin and all the logic that is written for that would then have to be rewritten. If Lathe Posts had FANUC tool methods supported differently then all of this would not be needed, :turned:

 

Thing is if I only used one offset per tool then everything is golden it is the use of different offsets for the same tool is when everything starts going crazy. 5 different +/-.0002 diameters needing to be held with one tool so the T0505, T0514, T0515, T0516 and T0525 goes crazy and the calling of the same tool after the use of a live center from the lower turret to then rough and finish the OD also freaks it out.

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