What's new
What's new

OSP U10L loop program for a bar puller

EnginCycles

Aluminum
Joined
Aug 11, 2008
Location
Philadelphia,PA
I have a program that makes a part and will end with a bar puller to set the material up for the next part. I have enough material in there to make say 20 parts and then I need to put in a new bar. Since M98 is not an option on an Okuma I have been reading the manual and it makes me feel rather stupid because how to run a subroutine or subprogram does not make sense. I just want to repeat the program 20 times which seems like it should be simple (and it probably is) but I am not finding the info I need.

Any help and or examples of the code would be super.

Thanks in advance.

-Drew
 
You need to create a schedule program.
I can check the exact syntax in the AM, but

LOOP.SDF. (schedule program name)
PSELECT MAIN.MIN (main program name) ,,,20
END
 
You need to create a schedule program.
I can check the exact syntax in the AM, but

LOOP.SDF. (schedule program name)
PSELECT MAIN.MIN (main program name) ,,,20
END

So I would enter this in MDI or can I insert it at the top of a program? I know this sounds dumb but I am still getting the hang of this Okuma stuff. This at least seems easier than everything else I have read.
 
hy Drew :) i dont have experience with u10l, but osp300

i have each operation inside a procedure ( ssb file ) which i call from the main program ( min file )

puller procedure :

Code:
OS08

    M09
    safe position
    M19  T... M66

    G00 X0 Z-25.035+2.5            ( Z=-part_length-cut_knife+clearance )
    G00 Z-35.295                   ( clamp position )
    M84
    G01 Z25.335     F1000 G94 G91  ( Z=part_length+cut_knife+a_bit_more_4_straight_face )
    M83
    G00 Z2.5 G90

RTS

main program :

Code:
  ( intro )

    G50 S2000
    M867 ( cas          : off )
    M216 ( rapid ignore : on  )

  ( main )

    NN01    CALL OS01
    NN02    CALL OS02
    NN03    CALL OS03
    NN04    CALL OS04
    NN05    CALL OS05
    NN06    CALL OS06
    NN07    CALL OS07

    IF [ VRSTT NE 0 ] NN99
              V29 = V29 + 1
    NN99 IF [ V29 EQ V28 ] NEXIT

    NN08    CALL OS08     ( puller )

    IF [ V29 LT V28 ] NN01

    NEXIT G00 safe position M05 M63 M09

  ( outro )

  ( M84  )
  ( G195 SP=1 )
  ( M215 ) ( rapid ignore : off )
    M866   ( cas          : on  )
    M02

as it can be seen, puller is skipped on last part

also i run programs where the bar puller is called after crafting more than 1 part :) for example, if a bar can deliver 21 parts, and i can craft 3 parts without unclamping the chuck, than there will be 21/3-1=6 calls to the puller procedure

i hope that most of those codes are cross compatible ; remove M867, 866, 216

kindly !
 
Last edited:
So I would enter this in MDI or can I insert it at the top of a program? I know this sounds dumb but I am still getting the hang of this Okuma stuff. This at least seems easier than everything else I have read.

It is its own program.
Go into EDIT.
Type LOOP.SDF
Hit ENTER

Type this:
PSELECT MAIN.MIN (main program name) ,,,Q20 (syntax corrected)
END

Hit EDIT QUIT

Go to AUTO mode.
Press soft key SP SELECT.
Select LOOP.SDF.

Press cycle start.


To edit the .SDF, you will need to specify the whole filename, or *.*
If you only search * it will only display .MIN programs.
 
Schedule programs are such a pain in the ass (at least in my experience).

Sub programs on an Okuma go at the end of the main program AFTER THE M30%

You call it up anywhere you want inside the main program with a CALL OPART Q19
O---- (The letter O, and then 4 characters for the main program title... and the Q is your loop)
And then at the end of you sub program you put an RTS

For example:

Main program
face code
turn code
blah
blah
CALL OPART Q19
more main program stuff
blah blah
M30
%
OPART
sub program code
blah
blah
blah
RTS



That's it. It's really simple.
 
It is its own program.
Go into EDIT.
Type LOOP.SDF
Hit ENTER

Type this:
PSELECT MAIN.MIN (main program name) ,,,Q20 (syntax corrected)
END

Hit EDIT QUIT

Go to AUTO mode.
Press soft key SP SELECT.
Select LOOP.SDF.

Press cycle start.


To edit the .SDF, you will need to specify the whole filename, or *.*
If you only search * it will only display .MIN programs.


I get a 306 command character error when I try to enter LOOP.SDF and hit enter

Also if I can get past this when I write the program do I include the .MIN in the program name or just the program name and it knows it is a .MIN from the PSELECT MAIN.MIN?

Thanks,
Drew
 
Schedule programs are such a pain in the ass (at least in my experience).

Sub programs on an Okuma go at the end of the main program AFTER THE M30%

You call it up anywhere you want inside the main program with a CALL OPART Q19
O---- (The letter O, and then 4 characters for the main program title... and the Q is your loop)
And then at the end of you sub program you put an RTS

For example:

Main program
face code
turn code
blah
blah
CALL OPART Q19
more main program stuff
blah blah
M30
%
OPART
sub program code
blah
blah
blah
RTS



That's it. It's really simple.

Little history.

I have yet to get my RS-232 hook up working so I am hand coding all my programs now (not a big deal with a 2 axis machine). All my programs are words followed by .MIN so I guess I have no sub programs. I only number the lines with a tool change. Starting with N10 for the first tool and ending with whatever. For programs that can be tweaked I added more numbered lines and alter those lines to adjust a program (most in a -Z value). I don't have any % but I assume that is only used when sending over programs like I do on my mill.

so when you say OPART is that O and then "program name including .MIN" or would it be a line number that I want to jump to. I get all the above except I do not have any sub routines only main programs. Sorry for being suck a neophyte!
 
Press the EDIT key next to the MDI key.
Press F4 key (EDIT).
Type LOOP.SDF. Create your program.

Same procedure to create your main program.

No you don't need to specify .MIN, it automatically defaults to .MIN
 
Little history.

I have yet to get my RS-232 hook up working so I am hand coding all my programs now (not a big deal with a 2 axis machine). All my programs are words followed by .MIN so I guess I have no sub programs. I only number the lines with a tool change. Starting with N10 for the first tool and ending with whatever. For programs that can be tweaked I added more numbered lines and alter those lines to adjust a program (most in a -Z value). I don't have any % but I assume that is only used when sending over programs like I do on my mill.

so when you say OPART is that O and then "program name including .MIN" or would it be a line number that I want to jump to. I get all the above except I do not have any sub routines only main programs. Sorry for being suck a neophyte!

OPART is more of a line number in this case or an identifying block On Fanuc style it would be
.
.
.
M97 P1234 L19
.
.
M30

O1234
.
.
.
M99

For an external subroutine call the program extension is .SSB.
 
Press the EDIT key next to the MDI key.
Press F4 key (EDIT).
Type LOOP.SDF. Create your program.

Same procedure to create your main program.

No you don't need to specify .MIN, it automatically defaults to .MIN

Getting a 5209 program end error. Does it need a M30 or M02? I only put END

edit! added M30 and it loaded it. Now to see if it actually works!
 
A piece of info for when you get up and running:

On the CHECK DATA screen, right hand column near the bottom, there are 2 variables

pr (number of parts to make. from your Q value)
pe (number of part it is currently running)

As soon as you hit cycle start your values should read
pr 20
pe 1
 
It claims that PSELECT is 5 or more characters and it needs to be 4. That is the info within the alarm explanation.

PSELECT is the correct command. Check the spelling.

From the Alarm Manual:

2227 Mnemonic or local variable

The local variable name is longer than 4 characters (you aren't using local variables)
or the reserved word (mnemonic) command of 5 or more characters is misspelled.
 
A piece of info for when you get up and running:

On the CHECK DATA screen, right hand column near the bottom, there are 2 variables

pr (number of parts to make. from your Q value)
pe (number of part it is currently running)

As soon as you hit cycle start your values should read
pr 20
pe 1

OK got it one step further. I missed your go to SP program select. Now I got it to load (although it does not show the program on the screen). Now is says alarm 2285 Schedule Program Main Program Load and below on the screen it says 5201 not found main program file. I just loaded the program and it worked.
 
When you press SP PROG SELECT it will not show the schedule program.
As soon as you push cycle start the main program will be displayed.

Another trick I use is, in your main prog put a M01 just before the M30.
.
.
.
M01
M30

You can turn on op. stop after running the last tool to check the part, make edits, whatever.

Also, if you edit the main program you will need to reselect the schedule program for your edits to take effect.
 
Well I tried the other system of the CALL OPART Q19 and it worked. I just need to edit the program so bulk of it is essentially listed in the sub program code below M30. That was actually about as easy as I was hoping it could be compared to M98!
 








 
Back
Top