![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| G-Code Programing Discuss G-code programing and problems here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#2
| |||
| |||
| That’s pretty vague. What kind of control are you using? What kind of machine are you using? What do you mean by mode in/mode out? On most machines a subroutine is called with a M98 followed by the program number you want to call and then an M99 to end the subroutine. Example: O0001(main program) … M98P1000 M30 O1000(subprogram) … M99 Program 1 will call program 1000 at the M98 line and when program 1000 is finished and reads the M99 it will end and return to the M30 line of program 1. Stevo |
|
#5
| |||
| |||
| What kind of control are you using? What kind of machine are you using? What do you mean by mode in/mode out? I am using the Okuma LB15 1986 with control: OSP 5000L. MODE IN/MODE OUT is a subroutine and is a instruction to jump from a main prog to a subroutine. |
| Sponsored Links |
|
#6
| ||||
| ||||
| For example, maybe you are cutting a special shaped groove on the OD of a part... Name the Subprogram, Following these rules: Must start with the letter O Use up to 4 Alphanumeric characters for the "Name" of the sub program. i.e. can use Numbers or Letters, but if you start with a number, you must use all numbers, if you start with a Letter, you can use letters and numbers. Valid examples are: O1234 O1 O0001 OPRG OPRG1 Invalid examples: 1234 <- no starting letter O O12345 <- too many characters after the "O" O123A <- started with a number and then used letters no no. Your subroutine must end with the letters "RTS" on the last line. i.e. A valid subroutine could follow this sample: OSUB1 ... .. . BLAH BLAH appropriate machine here BLAH . .. ... RTS Using a subroutine from within the main program is as follows: N100 G0 X300 Z500 N102 M3 S1200 N104 M8 N106 T010101 N108 X50 Z50 (POSITION AT START POINT FOR SUB ROUTINE) N110 CALL OSUB1 (CALL THE ROUTINE...) N112 G0 Z40 (MOVE TO POSITION FOR NEXT GROOVE) N114 CALL OSUB1 (MACHINE GROOVE) N116 G0 Z30 (MOVE TO POSITION FOR NEXT GROOVE) N118 CALL OSUB1 (MACHINE GROOVE) N120 G0 X300 Z500 (GO HOME) N122 M5 M9 N124 M2 OSUB1 (SUB TO DO SOMETHING... I.E. PLUNGE A GROOVE) N1000 G1 X40 F0.15 N1002 G4 F0.25 N1004 G0 X50 RTS In that example, I was machining a groove down to 40mm diameter, at any given position on Z axis. First I move the machine into the position I wanted the groove at, and then I called the subroutine to machine the groove. Obviously, this is a very simple example of what can be done, but it is for demo purposes only. Now, using the MODIN/MODOUT approach, the above program can be written as follows: N100 G0 X300 Z500 N102 M3 S1200 N104 M8 N106 T010101 N108 X50 Z50 (POSITION AT START POINT FOR SUB ROUTINE) N110 MODIN OSUB1 (TELL THE MACHINE THAT FOR EACH MOVE DESIGNATED, BETWEEN THIS LINE AND MODOUT, YOU WANT SUB ROUTINE OSUB1 CALLED) N112 Z40 (MOVE TO POSITION FOR NEXT GROOVE) N116 Z30 (MOVE TO POSITION FOR NEXT GROOVE) N118 MODOUT (NO MORE SUB CALLS ACTED UPON) N120 G0 X300 Z500 (GO HOME) N122 M5 M9 N124 M2 OSUB1 (SUB TO DO SOMETHING... I.E. PLUNGE A GROOVE) N1000 G1 X40 F0.15 N1002 G4 F0.25 N1004 G0 X50 RTS A simple analogy would be to use an example of a drilling cycle on a mill: 1st specify the drilling cycle pattern... 2nd specify where you want the holes 3rd cancel the drilling cycle The 1st part is the line N110 in the above example the lines N112 and N116 in the above example are the 2nd step the 3rd step, cancelling the routine is done on line N118 Using M98 Pxxxx is FANUC talk... NOT understood by an Okuma Nor is the M99 understood by an Okuma in this manner. The equivalent to the M99 on an Okuma is the RTS (ReTurn from Subroutine). The equivalent of the M98 Pxxxx is the CALL Oxxxx statement. Hope this helps Brian. Last edited by broby; 08-11-2010 at 07:56 AM. |
|
#7
| |||
| |||
Hi Broby Thanks for the post. I am sorry for my enlish. I'll try to explain what I tried. I did write the follow program: N100 G97 S1000 M04 N101 G00 X75 Z10 T010101 N102 X50 Z-10 N103 Call OSUB1 N104 Z-30 N105 Call OSUB1 N106 M05 N107 G00 X500 Z600 N108 M02 Osub1 N1000 G00 X40 N1001 G01 X30 F0.1 N1002 G00 X50 RTS When the engine is reading this program,the error 2511(the file is not found) follows. May be this manner is an optie,who's buying to completing the engine? I am a machine operator and i like to learning this. Thanks for your supporting. Dick |
|
#8
| ||||
| ||||
The earlier controls (like yours) can NOT use lower case letters. So first try changing all lowercase letters to UPPERCASE then once that is working, try the following change... To do this same routine with MODIN/MODOUT this is how I would change your program... N100 G97 S1000 M04 N101 G00 X75 Z10 T010101 N102 X50 Z-10 N103 MODIN OSUB1 N104 Z-10 N105 Z-30 N106 MODOUT N107 M05 N108 G00 X500 Z600 N109 M02 OSUB1 N1000 G00 X40 N1001 G01 X30 F0.1 N1002 G00 X50 RTS Hope this is helpful? Cheers Brian. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MSC-516 Will not load subroutines | BluegrassPicker | Mori Mills | 5 | 06-16-2010 05:56 AM |
| Need Help!- with subroutines | Thad Swarfburn | G-Code Programing | 0 | 06-24-2009 08:37 PM |
| EMC and Subroutines? | watchman | LinuxCNC (formerly EMC2) | 9 | 06-17-2007 02:30 PM |
| Oi subroutines help | mishikwest | Fanuc | 1 | 08-01-2006 05:17 PM |
| Fanuc 15m Subroutines | BROCD | Fanuc | 11 | 02-27-2006 07:04 AM |