586,341 active members*
3,371 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > OSP5000M-G sub program. Can't be done?
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2008
    Posts
    16

    OSP5000M-G sub program. Can't be done?

    I found a few post here where someone has asked how to replace M98/M99 from Fanuc on an Okuma. Many post have stated the CALL command replaces this. I'm not sure that's true as I can't get it to work. When I try to use it the same way I used M98/M99 on the Fanuc I get an error saying no subprogram exists. Here is the senario: On the fanuc I had a sub program called O1234 that milled a pocket. I could run this program from 6 different programs using M98 O1234 and putting an M99 at the end of O1234. The control would leave the main program O1000, run O1234, then jump back O100. I could call up O1234 from any number of other programs, O1000, O2000, O3000. The Okuma will not do this. If I use the CALL command, the sub program must be inside the body of the main program with an O1234 and RTS at the end. It will not leave the main program, run the sub, then return. This is very difficult if I have 8 different programs I need to have run that same sub program. I tried creating a program called O1234.sub, O1234.min, but it always gives me the error unless that program is captured in the main program. Does anyone know how to create a small sub program that can be run from any number of other programs? This is what M98/M99 does on the Fanuc. Thanks in advance for any help!

    james

  2. #2
    Join Date
    Apr 2006
    Posts
    822
    Quote Originally Posted by drjimmy View Post
    I found a few post here where someone has asked how to replace M98/M99 from Fanuc on an Okuma. Many post have stated the CALL command replaces this. I'm not sure that's true as I can't get it to work. When I try to use it the same way I used M98/M99 on the Fanuc I get an error saying no subprogram exists. Here is the senario: On the fanuc I had a sub program called O1234 that milled a pocket. I could run this program from 6 different programs using M98 O1234 and putting an M99 at the end of O1234. The control would leave the main program O1000, run O1234, then jump back O100. I could call up O1234 from any number of other programs, O1000, O2000, O3000. The Okuma will not do this. If I use the CALL command, the sub program must be inside the body of the main program with an O1234 and RTS at the end. It will not leave the main program, run the sub, then return. This is very difficult if I have 8 different programs I need to have run that same sub program. I tried creating a program called O1234.sub, O1234.min, but it always gives me the error unless that program is captured in the main program. Does anyone know how to create a small sub program that can be run from any number of other programs? This is what M98/M99 does on the Fanuc. Thanks in advance for any help!

    james
    Well James,
    Subprograms on an Oluma are very easy, if you get a few things straight first.
    First point is that M98/M99 IS replaced by the CALL Oxxxx / RTS
    Putting program specific subs at the end of the main program is an easy way of keeping your house in order, in terms that the sub program for that particular program is always loaded into the machine when the program is sent over.
    To use a "generic" sub-routine in a multitude of programs, place the subprograms into a file with an extension of .SSB
    These files are known as "System Sub-program" files and can be accessed by any main program. I know this works because I use them extensively.
    for example:
    main program (called FRED.MIN)
    N1 Blah Blah Blah
    N2 CALL O100
    N3 CALL O200
    N4 CALL OFACE
    N5 Blah blah blah...
    N100 M2

    In another file called "SUBS.SSB" (for example) you will have the subroutines thus:

    COMMENTS AS REQUIRED
    THESE ARE NOT REQUIRED TO BE IN BRACKETS!
    AS THEY ARE OUTSIDE OF ANY CODE.
    *
    O100 (SUB TO DO SOMETHING!)
    N100 G0 ...
    N102 G1...
    N104 WHAT EVER CODE YOU NEED
    N106 ...
    RTS
    *
    *
    O200 (SUB TO DO SOMETHING ELSE!)
    N100 G0 ...
    N102 G1...
    N104 WHAT EVER CODE YOU NEED, BUT IS DIFFERENT TO ABOVE.
    N106 ...
    RTS
    *
    *
    OFACE (SUB TO MILL FACE...)
    N100 G0 ...
    N102 G1...
    N104 WHAT EVER CODE YOU NEED
    N106 ...
    RTS
    *
    *


    Putting subroutines into a file with .SUB extension will work, but when you program select you need to also reference the name of the subprogram.
    ie. PS MAIN,,SUBS.SUB
    I am pretty sure that you can leave off the .SUB part of the filename, but as I am not at the machine... you will have to try it yourself.
    The easiest solution is to put your generic sub-programs into a file with the .SSB extension. Then all you need to do is Program Select your main program.

    Hope this info helps
    Regards
    Brian.

  3. #3
    Join Date
    Feb 2008
    Posts
    16
    Thank You! It just so happens that I dug around yesterday after my post and discovered the same thing. You put it all in one reply which was nice, I had to get bits and pieces from many other posts to get it all straight. I am now running a generic sub accessed from 3 other programs on my machine right now. This is so much better than putting the sub at the end of each main program! What I did noticed though is that if you have a sub called OTAP at the end of a main program and also an OTAP inside the .SSB program, it will not alarm telling you that you have two. It will default to the one in the main program. That probably is an assumed situation, but I thought I would mention it incase anyone reads this later so they can be aware of their sub names and make sure that don't use the same name twice in two places. Thanks for the fast reply! If I hadn't stumbled upon the answer myself your reply would have most definitley done the trick.

    james

  4. #4
    Join Date
    Apr 2006
    Posts
    822
    Cheers,
    Good to see that you have got it figured out.
    Brian.

  5. #5
    Join Date
    Feb 2008
    Posts
    16
    followup question: Can someone explain the rules for sub program names? I ran into a few situations and I'd like to get the rules for sub programs contained in ann .SSB file. First is how many characters are you allowed after the O? is it 4? Also, what is the rule for numbers and letters? My machine will not accept OR in the .SSB file, but will accept ORT. This is odd because it accepts OT and OL. I had to change all my OR's to ORT's. Another oddity. It will let me do O followed by letters but not letters and numbers? It will not take O516C or O516P. It will also not take OC516. So, can you only have 4 characters after the O either letters or numbers but not both? if so, that is a little disappointing. I can really nail down the definitions of the subs if I'm allowed to use both, but just numbers or just letters really makes it hard. thanks

  6. #6
    Join Date
    Feb 2008
    Posts
    16
    oh yeah, the error I get is a 63 right side error of some sort.

Similar Threads

  1. Replies: 0
    Last Post: 12-27-2010, 09:55 AM
  2. Control paramater help. Okuma OSP5000m
    By Lafaso870 in forum Mastercam
    Replies: 0
    Last Post: 12-03-2010, 08:10 AM
  3. osp5000m
    By stonehengemfg in forum Okuma
    Replies: 4
    Last Post: 06-12-2010, 03:39 PM
  4. Replies: 0
    Last Post: 01-28-2009, 11:12 AM
  5. osp5000m parameter
    By Hwangbogeun in forum Okuma
    Replies: 0
    Last Post: 08-10-2008, 12:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •