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 MC-4VB tool change variable for active tool


Recommended Posts

Hello,

 

I am working on a post for a Okuma MC-4VB vertical 50 taper mill. I started with a MPmaster post. I need it to have the following code before every tool change. How do I do this in the post..

 

 

Needs to look like this..

 

(prog)

...

N2 IF [VATOL EQ 10] N4 <---------------- I need the [VATOL EQ (the current tool nuber)] N4 --------------- to post before every tool change...

N3 T10 M6

N4 S---- M3

.......

........

 

In my MC-4Vb, VATOL is the system variable for active tool. Line N2 is a conditional that will jump to N4 if the tool 10 is already there, if not, it will proceed to N3 and change the tool

 

Thanks

Link to comment
Share on other sites

I'm not tested this, but should work. :)

 

Very first thing: Make a backup of your post! :)

 

Define a variable (in start of post) to hold actual T number for VATOL

 

# Set variable for VATOL
oku_VATOL : 0 #VATOL

 

 

Find this section in ptlchg_com postblock.

 

if stagetool >= zero,
 [
 if omitseq$ = 1 & tseqno > 0,
	 [
	 if tseqno = 2, n$ = t$
	 pbld, *n$, *t$, "M06", ptoolcomm, e$
	 ]
 else, pbld, n$, *t$, "M06", ptoolcomm, e$
 ]

 

 

Change it:

("N4" will be an empty line)

 

if stagetool >= zero,
 [
    oku_VATOL = t$
 if omitseq$ = 1 & tseqno > 0,
	 [
	 if tseqno = 2, n$ = t$
        "N2 IF [VATOL EQ ", *oku_VATOL, "] N4", e$
	 pbld, *n$, *t$, "M06", ptoolcomm, e$
        "N4", e$
	 ]
 else,
        [
        "N2 IF [VATOL EQ ", *oku_VATOL, "] N4", e$
        pbld, n$, *t$, "M06", ptoolcomm, e$
        "N4", e$
        ]
 ]

 

If you need to follow the different "N" line numbers at toolchanges, thats a bit different story, but not impossible.

Let me think.... Hmm... Yes, I think you have to, beacuse it's an OKUMA... :S

...but give a try for this first.

HTH

 

Is it an older controll? OSP5000?

Link to comment
Share on other sites

This is what I did, I'm sure there is a better way. I would like to know what it is. I only use line numbers on the first few lines of a toolchange.

 

I created this Variable here,

 

# --------------------------------------------------------------------------

# Toolchange / NC output Variable Formats

# --------------------------------------------------------------------------

fmt 4 okuma_skip_toolnumber

 

 

I added / modified the code under this part of the post

 

#Start of file for non-zero tool number

 

spaces$=0

okuma_skip_toolnumber = t$

pbld, n$, " IF [VATOL EQ ", *okuma_skip_toolnumber,"] ",

n$ = n$ + seqinc$,

n$ = n$ + seqinc$,

*n$, " (SPINDLE TOOL CHECK)", e$

spaces$=sav_spc

n$ = n$ - seqinc$

n$ = n$ - seqinc$

pbld, n$, *t$, "M6", e$

pbld, *n$,[if nextdc$ <> 7, *speed, *spindle], pgear, strcantext, "(SPINDLE TOOL JUMP)", e$

 

 

output looks like this..

 

N1 IF [VATOL EQ 104] N3 (SPINDLE TOOL CHECK)

N2 T104 M6

N3 S1055 M3 (SPINDLE TOOL JUMP)

Link to comment
Share on other sites

This is what I did, I'm sure there is a better way. I would like to know what it is. I only use line numbers on the first few lines of a toolchange.

 

I created this Variable here,

 

# --------------------------------------------------------------------------

# Toolchange / NC output Variable Formats

# --------------------------------------------------------------------------

fmt 4 okuma_skip_toolnumber

 

 

I added / modified the code under this part of the post

 

#Start of file for non-zero tool number

 

spaces$=0

okuma_skip_toolnumber = t$

pbld, n$, " IF [VATOL EQ ", *okuma_skip_toolnumber,"] ",

n$ = n$ + seqinc$,

n$ = n$ + seqinc$,

*n$, " (SPINDLE TOOL CHECK)", e$

spaces$=sav_spc

n$ = n$ - seqinc$

n$ = n$ - seqinc$

pbld, n$, *t$, "M6", e$

pbld, *n$,[if nextdc$ <> 7, *speed, *spindle], pgear, strcantext, "(SPINDLE TOOL JUMP)", e$

 

 

output looks like this..

 

N1 IF [VATOL EQ 104] N3 (SPINDLE TOOL CHECK)

N2 T104 M6

N3 S1055 M3 (SPINDLE TOOL JUMP)

 

Ok I think I might be changing it in th wrong place.. It posted out fine for the first tool but the next tool there is no M6 or anything.. Below is where I put the changes in the mpmaster post

 

 

N100 G00 G17 G20 G40 G80 G53 G90

N110 G91 G30 P2.0 Z0.

N120 IF [VATOL EQ 1] N140 (SPINDLE TOOL CHECK) <------------------- this looks great --------------->

N130 T1 M6

N140 S2800 M03 (SPINDLE TOOL JUMP)

N150 (MAX - Z4.)

N160 (MIN - Z-1.025)

N170 M08

N180 G00 G17 G90 G54 X8.665 Y.5 S2800 M03

N190 G56 H4 Z4. T12

N200 Z.2

N210 G94 G01 Z-1.025 F120.

N220 G41 D4 Y0. F80.

N230 Y-2.4375

N240 G02 X8.25 Y-2.8525 I-.415 J0.

N250 G03 X2.8525 Y-8.25 I0. J-5.3975

N260 G02 X2.4375 Y-8.665 I-.415 J0.

N270 G01 X0.

N280 G40 X-.5

N290 G00 Z2.975

N300 X8.635 Y.5

N310 Z.2

N320 G01 Z-1.025 F120.

N330 G41 D4 Y0. F80.

N340 Y-2.4375

N350 G02 X8.25 Y-2.8225 I-.385 J0.

N360 G03 X2.8225 Y-8.25 I0. J-5.4275

N370 G02 X2.4375 Y-8.635 I-.385 J0.

N380 G01 X0.

N390 G40 X-.5

N400 G00 Z4.

N410 (FINISH MILLS OUTSIDE PROFILE WITH 3/4 ENDMILL)

N420 X8.625 Y.5

N430 Z.2

N440 G01 Z-1.025 F120.

N450 G41 D4 Y0. F40.

N460 Y-2.4375

N470 G02 X8.25 Y-2.8125 I-.375 J0.

N480 G03 X2.8125 Y-8.25 I0. J-5.4375

N490 G02 X2.4375 Y-8.625 I-.375 J0.

N500 G01 X0.

N510 G40 X-.5

N520 G00 Z4.

N530 M09

N540 M05

N550 G91 G30 P2.0 Z0.

N560 M01 <------------------------ not tool change after this line --------------------------->

N570 (MAX - Z4.)

N580 (MIN - Z-1.025)

N590 M08

N600 G00 G17 G90 G54 X8.75 Y-2.5925 S550 M03

N610 G56 H12 Z4. T1 <-------------------------- There is a height offset for t12 ------------------>

N620 (ROUGH AND FINISH MILLS WITH 15 DEG TAPER E.M.)

N630 Z.2

N640 G94 G01 Z-1.025 F125.

N650 G41 D12 X8.25 F5.

N660 G03 X2.5925 Y-8.25 I0. J-5.6575

N670 G01 G40 Y-8.75

N680 G00 Z2.975

N690 X8.75 Y-2.5625

N700 Z.2

N710 G01 Z-1.025 F125.

N720 G41 D12 X8.25 F5.

N730 G03 X2.5625 Y-8.25 I0. J-5.6875

N740 G01 G40 Y-8.75

N750 G00 Z4.

 

 

This is where i changed the mpmaster post

 

ptlchg_com #Tool change common blocks

if force_output | sof,

[

result = force(ipr_type,ipr_type)

result = force(absinc$,absinc$)

result = force(plane$,plane$)

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#ptoolcomment

if sof & scomm_sav <> snull,

[

spaces$=0 <------------------------------------------------------------ From here to ------------------------------------->

okuma_skip_toolnumber = t$

pbld, n$, " IF [VATOL EQ ", *okuma_skip_toolnumber,"] ",

n$ = n$ + seqinc$,

n$ = n$ + seqinc$,

*n$, " (SPINDLE TOOL CHECK)", e$

spaces$=sav_spc

n$ = n$ - seqinc$

n$ = n$ - seqinc$

pbld, n$, *t$, "M6", e$

pbld, *n$,[if nextdc$ <> 7, *speed, *spindle], pgear, strcantext, "(SPINDLE TOOL JUMP)", e$ <------------------------------------ Here ------------------------------>

]

spaces$=0

if output_z = yes$,

[

preadbuf5

if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,

[

n$, pspc, scomm_str, "MAX - ", *max_depth, scomm_end, e$

n$, pspc, scomm_str, "MIN - ", *min_depth, scomm_end, e$

]

]

spaces$=sav_spc

pstock

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

pindex

if safe_index,

 

 

And here

 

 

# --------------------------------------------------------------------------

# Toolchange / NC output Variable Formats

# --------------------------------------------------------------------------

fmt "T" 4 t$ #Tool No

fmt "T" 4 first_tool$ #First Tool Used

fmt "T" 4 next_tool$ #Next Tool Used

fmt "D" 4 tloffno$ #Diameter Offset No

fmt "H" 4 tlngno$ #Length Offset No

fmt "G" 4 g_wcs #WCS G address

fmt "P" 4 p_wcs #WCS P address

fmt "S" 4 speed #Spindle Speed

fmt "M" 4 gear #Gear range

fmt 4 okuma_skip_toolnumber <----------------------added this line here --------------------------->

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

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