Hello Guest it is March 28, 2024, 04:50:03 AM

Author Topic: HELP WITH A M98 SUBROUTINE  (Read 27343 times)

0 Members and 1 Guest are viewing this topic.

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: HELP WITH A M98 SUBROUTINE
« Reply #10 on: April 24, 2013, 05:47:20 PM »
Your welcome.
M30 should only be used once, at the end of the program. If not used at the end of the program, the program will indeed end, and rewind, ignoring all that comes after it.
It is also better to lay out your programs for a smooth flow. Notice the sub calls are together, the subs are at the tail end, and the rest of the code is back up above the subs with the M30 ending the program. With a quick glance, you can tell that the program consist of a Z move at the beginning, then runs two subs, then makes a couple more moves, then ends (as indicated by the M30). This keeps you from scouring through a big long file, looking for an error(s) when things don't go as expected.
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."
Re: HELP WITH A M98 SUBROUTINE
« Reply #11 on: April 26, 2013, 12:51:17 PM »
OK I tried using what you did and writing another program, no luck.

(Tool #810 8T brazed carbide keyseat)
(Work piece 1.5X.720X.648")
N10   G20 G17 G90  G54 S500 F5.3
N20   G0  X1.891 Y.9983
N30       Z-.490   M3 M8
N40   G1  X-1.866 Y-.9623

N50   M98 P1234 L11

N100  G90 G1  X1.561 Y.521
N110  G0  X1.926 Y1.034 
N120  G91 G1 Z.032

N130  M98 P1235 L1

N180  G1 Z-.064

N190  M98 P1235 L1

N200  G90 G0 Z0 M5 M9
N210  X0 Y2 M30


     O1234
N70  G91 G91.1
N80  G2 X-.0037 Y.0208 R.015
N80  G1  X-.0219 Y-.0578
N90  M99

     O1235
N150 G91 G1 X-.366 Y-.513 F6.5
N160 G0 X.366 Y.513 
N170 M99
%

Offline Sam

*
  • *
  •  987 987
    • View Profile
    • hillbillyhilton.com
Re: HELP WITH A M98 SUBROUTINE
« Reply #12 on: April 26, 2013, 01:53:25 PM »
Take out all the extra spaces in the file. The spaces before the "O1234" is actually what was causing the problem, but take out all the other ones too just to be tidy and avoid a potential problem. Some controls may not care if you have spaces, some do. Every control software has its quirks, and what works with one may not work with another. The best thing to do is just make every file as tidy as can be, and then errors are much easier to diagnose.

Other than that, the file looked fine and the subs ran perfect.

Also, you may need to change the G91.1 to G91.0
I have no idea what your actually wanting, so it may be correct as-is, but changing it just made it "look" more appropriate.



(Tool #810 8T brazed carbide keyseat)
(Work piece 1.5X.720X.648")
N10   G20 G17 G90 G54 S500 F5.3
N20   G0  X1.891 Y.9983
N30   Z-.490   M3 M8
N40   G1  X-1.866 Y-.9623

N50   M98 P1234 L11

N100  G90 G1  X1.561 Y.521
N110  G0  X1.926 Y1.034
N120  G91 G1 Z.032

N130  M98 P1235 L1

N180  G1 Z-.064

N190  M98 P1235 L1

N200  G90 G0 Z0 M5 M9
N210  X0 Y2 M30

O1234
N70  G91 G91.1
N80  G2 X-.0037 Y.0208 R.015
N80  G1  X-.0219 Y-.0578
N90  M99

O1235
N150 G91 G1 X-.366 Y-.513 F6.5
N160 G0 X.366 Y.513
N170 M99
%
« Last Edit: April 26, 2013, 01:55:37 PM by Sam »
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."
Re: HELP WITH A M98 SUBROUTINE
« Reply #13 on: April 26, 2013, 03:05:54 PM »
I finally got all the bugs out. 

(Tool #810 8T brazed carbide keyseat)
(Work piece 1.5X.720X.648")
N10   G20 G17 G90  G54 S500 F5.3
N20   G0  X1.891 Y.9983
N30       Z-.490   M3 M8
N40   G1  X1.866 Y.9623
N50   M98 P1234 L11
N100  G90 G1  X1.561 Y.521
N110  G0  X1.926 Y1.034 
N120  G91 G1 Z.032
N130  M98 P1235 L1
N180  G1 Z-.064
N190  M98 P1235 L1
N200  G90 G0 Z0 M5 M9
N210  X0 Y2 M30

O1234
N70  G91
N80  G2 X-.0037 Y.0208 R.015
N80  G1  X-.0219 Y-.0578
N90  M99

O1235
N150 G91 G1 X-.366 Y-.513 F6.5
N160 G0 X.366 Y.513 
N170 M99
 
Again thank you Oh so verry much.  You will make a programmer out of me yet.