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:

Okuma Canned Threading Cycle


Recommended Posts

Hello everyone,

 

I am currently making a post for some OSP-200LA lathes that we have here. I have been able to get the post to output all of the necessary code, the only problem is for some of the output formats I cannot get it to post a decimal. I have tried to change the output number to one that I created and it still will not work. 

 

Here is the fs Statements:

# --------------------------------------------------------------------------
# Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta
# --------------------------------------------------------------------------
#Default english/metric position format statements
fs2 1   0.7 0.6     #Decimal, absolute, 7 place, default for initialize (
fs2 2   0.4 0.3     #Decimal, absolute, 4/3 place
fs2 3   0.4 0.3d    #Decimal, delta, 4/3 place
#Common format statements
fs2 4   1 0 1 0     #Integer, not leading
fs2 5   2 0 2 0l    #Integer, force two leading
fs2 6   3 0 3 0l    #Integer, force three leading
fs2 7   4 0 4 0l    #Integer, force four leading
fs2 9   0.1 0.1     #Decimal, absolute, 1 place
fs2 10  0.2 0.2     #Decimal, absolute, 2 place
fs2 11  0.3 0.3     #Decimal, absolute, 3 place
fs2 12  0.4 0.4     #Decimal, absolute, 4 place
fs2 13  0.5 0.5     #Decimal, absolute, 5 place
fs2 14  0.3 0.3d    #Decimal, delta, 3 place
fs2 15  0.2 0.1     #Decimal, absolute, 2/1 place
fs2 16  0 4 0 4t    #No decimal, absolute, 4 trailing
#Default english/metric feed format statements
fs2 17  0.2 0.1     #Decimal, absolute, 2/1 place
fs2 18  0.4 0.3     #Decimal, absolute, 4/3 place
fs2 19  0.5 0.4     #Decimal, absolute, 5/4 place
fs2 20  1 0 1 0n    #Integer, forced output

# These formats used for 'Date' & 'Time'
fs2 21  2.2 2.2lt   #Decimal, force two leading & two trailing (time2)
fs2 22  2 0 2 0t    #Integer, force trailing                   (hour)
fs2 23  0 2 0 2lt   #Integer, force leading & trailing         (min)

# This format statement is used for sequence number output
# Number of places output is determined by value for "Increment Sequence Number" in CD
# Max depth to the right of the decimal point is set in the fs statement below
fs2 24  0^7 0^7     #Decimal, 7 place, omit decimal if integer value

#Canned Thread Cycle Output
fs2 25  0.4 0.3		#Decimal, absolute, 4/3 place

Here is the thread output:

# --------------------------------------------------------------------------
# Thread output
# --------------------------------------------------------------------------
fmt  "H" 25  thddepth$   #Thread height absolute
fmt  "D" 25  thdfirst$   #First depth cut in thread
fmt  "Q" 2  thdlast$    #Last depth cut in thread
fmt  "U" 25  thdfinish$  #G76 thread finish allowance
fmt  	 3  thdrdlt     #Thread R delta G92 and G76
fmt  	 3  thd_dirx    #Incremental X move for G76 mult starts
fmt  "K" 3  thd_dirz    #Incremental Z move for G76 mult starts
fmt  "P" 5  nspring$    #Number of spring cuts
fmt      5  thdpull     #G76 thread pull off
fmt  "B" 25  thdang      #G76 threading angle

Here is the G71 Threading Code:

pg76$            #G71 threading
      comment$
      gcode$ = zero
      lrapid$
      sav_xa = vequ(copy_x)
      if thdface$ = zero, copy_x = thdx3$
      else, copy_z = thdx3$
      if thdface$ = zero, copy_z = thdz2$
      else, copy_x = thdz2$
      pcom_moveb
      nstart_cnt = zero
      while nstart_cnt < nstarts$, pg71nstart
      pcom_movea
      prv_gcode$ = m_one
      copy_x = vequ(sav_xa)
      copy_x = copy_x + (thd_dirx * (nstarts$ - one))
      copy_z = copy_z + (thd_dirz * (nstarts$ - one))
      pcom_moveb
      pe_inc_calc
      !gcode$, !xabs, !yabs, !zabs, !xinc, !yinc, !zinc

pg71nstart      #G71 threading, for multiple starts
	  pg71
      nstart_cnt = nstart_cnt + one
      if nstarts$ <> one & nstart_cnt <> nstarts$,
      pbld, n$, *sgcode, thd_dirx, thd_dirz, e$

pg71         #G71 threading new style
        pbld, n$, *sthdgcode, pfxout, pfzout, pffr, thdang, thdfirst$, thdfinish$, thddepth$, e$

Here is the current output:

(TOOL - 8 OFFSET - 8)
(CHAMBER THREAD OD  INSERT - 16ER A 60)
G0 T0808
G97 S1646 M03
G0 G54 X.9116 Z.2145 M8
G71 X.7303 Z-.51 F.0625 B60. D180 U30 H407
M9

This is what I need it to output as:

(TOOL - 8 OFFSET - 8)
(CHAMBER THREAD OD  INSERT - 16ER A 60)
G0 T0808
G97 S1646 M03
G0 G54 X.9116 Z.2145 M8
G71 X.7303 Z-.51 F.0625 B60. D.018 U.003 H.0407
M9

Any help would be greatly appreciated. 

 

Matt

Link to comment
Share on other sites

There are some "preparatory" post blocks that get called for many of the canned cycles as part of "normal" processing for these posts.

 

There is likely a post block that is using the "newfs" function to override your setting, and it is assigning a "new" format statement number, "on-the-fly" to those variables. That is why you are seeing that the output doesn't change, even though you are changing the Format Assignment line for the variable itself.

 

In addition to the "new format" (newfs) function, there is a function for "new address" (nwadrs), which changes the "prefix string" assigned to an output variable. There is also a function for assigning a "suffix string" to be output after the numeric value (nwsufx).

 

Try searching for the variable name in the post, starting from the "top down", and I bet you'll encounter a "newfs" function that references that variable. I would recommend using the existing logic, and simply changing the value that is assigned to this variable.

 

The code would look something like this:

     result = newfs(25, thdfirst$) #Assign format #25 to variable
  • Like 1
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...