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:

o/t Fanuc Oi subroutines


Chris Rizzo
 Share

Recommended Posts

I've got a three deep subprogram ,#0001, 0002, and 0003. I can't get 0003 to call 0002 more than once, it should be calling it 10 times.

Any ideas?

 

 

Main part program:

 

%

O0001(CAP)

( CAP)

( 24-07-06 )

G20

(TOOL - 1 OFFSET - 1)

(1 VNMG .03 INSERT - VNMG-332)

G0 T0101

M8

G97 S2500 M03

....

....

....

....

....

/M30

M99

%

 

Running that program 6 times with an incremental advance and bar pulling:

 

%

O0002(CAP X 6)

(7/8 BAR)(3.00)

G10P0Z16.750

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

N0707(BAR PULLER)

G00 G40 G99

M05

M09

T0700

X3. Z-.625 T0707

G01 G98 X0. F300.

M16

G04 U.5

W2.750 F100.

M15

G04 U.5

X3. F300.

G00 G99 X8.0 Z6.

T0700

/M30

M99%

 

Trying to run 0002 ten times with this program, but it only runs it once

 

%

O0003

M98 P100002

M30%

 

I've run that exact same program (#0003) on a differnt file, and it works great for multiples. It's something do to with that program #0002 I suspect? Oi manual says it will support up to 4 subs deep.

 

thx

Link to comment
Share on other sites

2 more ideas. Try G65P0002L10

 

or;

 

O0002(CAP X 6)

(7/8 BAR)(3.00)

G10P0Z16.750

#100=0(RESET COUNTER)

WHILE[#1LE6]DO1

M98 P0001

G10P0W.450

#1=[#1+1]

END1

N0707(BAR PULLER)

G00 G40 G99

M05

M09

T0700

X3. Z-.625 T0707

G01 G98 X0. F300.

M16

G04 U.5

W2.750 F100.

M15

G04 U.5

X3. F300.

G00 G99 X8.0 Z6.

T0700

/M30

M99%

Link to comment
Share on other sites

thx tryon, Something funny is going on, I just tried:

%

0003

M98 P0002

M98 P0002

M30

%

 

just to see if I could get it to repeat once, and when it returns to the M98 line, the control acts like it's in single block mode...every push of the button will advance next line, so with 2 pushes of cycle start, the above program will call 00002 twice.

 

I don't have much macro experience, but I will give the above mentioned option a try.

 

thx.

Link to comment
Share on other sites

I'm just reading through my manual on G65 usage, and stumbled upon this:

 

"When an M98 block contains another NC command (for example G01 X1.0 M98 Pxxx), the machine stops in the single block mode. On the other hand, G65 does not stop the machine."

 

That leads me to beleive there is something towards the end of the 0002 program that is modal and causing problems, and kicking the 0003 program into single block. However there is nothing out of the ordinary that is "on", and the single block light does not illuminate on the control.

Link to comment
Share on other sites

Or you could do this, that will work for sure.

 

 

%

O0002(CAP X 6)

(7/8 BAR)(3.00)

 

N10 #500=1. (simple counter)

 

G10P0Z16.750

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

G10 P0 W.450

M98 P0001

N0707(BAR PULLER)

G00 G40 G99

M05

M09

T0700

X3. Z-.625 T0707

G01 G98 X0. F300.

M16

G04 U.5

W2.750 F100.

M15

G04 U.5

X3. F300.

G00 G99 X8.0 Z6.

T0700

 

#500=[#500+1.]

IF[#500LE10.]GOTO[-10]

 

/M30

M99%

Link to comment
Share on other sites

Thanks for all the input. I keep getting an alarm 128, "illegal macro sequence number. the sequence # in the branch command was not 0 to 9999, or it cannot be searched."

 

I also tried this:

 

%

O0006(CAP X 6)

(7/8 BAR)(3.00)

 

#100=0

#101=5.

 

N010

G10P0Z16.750

M98P0001

G10P0W.450

M98P0001

G10P0W.450

M98P0001

G10P0W.450

M98P0001

G10P0W.450

M98P0001

G10P0W.450

M98P0001

N0707(BAR PULLER)

G00G40G99

M05

M09

T0700

X3.Z-.625T0707

G01G98X0.F300.

M16

G04U.5

W2.750F100.

M15

G04U.5

X3.F300.

G00G99X8.0Z6.

T0700

 

#100=100+1.

IF[#100 EQ #101]GOTO600

GOTO N010

N600 M30

%

 

I get the same alarm 128.

Also tried line #100=[100+1]. No luck. This machine is new and I'm still figuring out/working out the bugs, and am ready to call applications and see what the heck is going on.

 

thx again.

Link to comment
Share on other sites

Still alarms out at the #100 line. I do have a few other macro programs in the control I use for jaw boring and the like. Maybe I have Macro "A" biggrin.gif

 

I've got a call and long email into applications support for the machine with all sorts of these questions. I'll let you know what I hear.

 

thanks again for all the interest and suggestions.

Link to comment
Share on other sites

Ok, your all gonna love this (or want to club me over the head biggrin.gif )

 

My 0002 program was saying this at the end

 

/M30

M99%

 

It needs to be

 

/M30

M99

%

 

yes their needs to be an EOB after the M99. The % sign cannot be in the same line as the M99. That causes subroutine errors and hang-ups. Hell, my dam fanuc keyboard does'nt even have a % sign on it!

 

So now this works:

 

%

0003

M98 P100002

M30

%

 

This was simple beyond belief, yet has caused me a headache for a good couple of days. Hope everyone can add this to their knowledge bank for the future.

 

I am now working on what the problem is with the Macro programs you all have suggested.

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