Hello Guest it is March 28, 2024, 05:52:09 PM

Author Topic: Sub programs  (Read 14295 times)

0 Members and 1 Guest are viewing this topic.

Offline Kai

*
  •  60 60
    • View Profile
Sub programs
« on: February 28, 2015, 11:37:39 AM »
I have never really used subs before but can not get this to work or am i just being dumb
N10 (Kev  Bracket)
N20 G90 G21 G17
N30 G80 G54
N40 G0 Y-11 X-11
N50 M03 S2000
N60 G98 P10 L17
N70 M05
N80 G0 Z10
N90 G0 X-11 Y-11
N100 M2

O10
N2990 M01
N2997 G01 Z20 F100
N3000 G91 Y1
N3005 g90
N3010 G01 X65 F100
N3020 G0 X-11
N3030 M99

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Sub programs
« Reply #1 on: February 28, 2015, 12:50:33 PM »
Line N060  (;-) you have G98 it should be M98

Offline Kai

*
  •  60 60
    • View Profile
Re: Sub programs
« Reply #2 on: February 28, 2015, 01:09:40 PM »
Oh my god  >:( ::) I'm dumb been looking at this for hours
I'm dyslexic but thats no excuse for stupidity

Offline Kai

*
  •  60 60
    • View Profile
Re: Sub programs
« Reply #3 on: February 28, 2015, 01:34:57 PM »
Thanks for that this is what I wanted it to do

N10 (Kev  Bracket)
N20 G90 G21 G17
N30 G80 G54
N40 G0 Y-11 X-11
N50 M03 S2000
N60 M98 P10 L24
N70 M05
N80 G0 Z39
N90 G0 X-11 Y-11
N100 M2





O10
N2990
N2997 G01 Z20 F100
N3000 G91 Y1
N3005 g90
N3010 G01 X65 F100
N3020 G0 X-11

N3030 M99

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Sub programs
« Reply #4 on: February 28, 2015, 02:11:52 PM »
I have done that MANY times NICE to have other members in the club.

IF I may make a suggestion when you Type in the SUB program name     O1 I always use the LOWER CASE O as o1. It is much easier to spot if you joined the OTHER sub club and substituded  01 for O1 .  With some fonts it is impossible to spot the difference.

Heck might as well warn you of the 3rd club (;-) When you end your program you will always have a M99 to return to the Main. I always add a % to the end of the program to MAKE SURE I did not forget the NEWLINE that has to be at the end of every program. You cannot see it BUT it has to be there for Mach3 to read the last line of active code. SO I always add the % so I know that mach3 will read the M99. THAT one will really drive you nuts looking for it. As there is NO visual difference as to how the code looks in the editor. The M99 just comes up missing when loaded.

M99
%

(;-) TP
« Last Edit: February 28, 2015, 02:22:43 PM by BR549 »

Offline Kai

*
  •  60 60
    • View Profile
Re: Sub programs
« Reply #5 on: February 28, 2015, 05:52:45 PM »
wow yes that has been driving me mad for ages lol
Thank you again

Offline Kai

*
  •  60 60
    • View Profile
Re: Sub programs
« Reply #6 on: April 14, 2016, 06:53:48 AM »
I have been looking at this for a while where have I gone wrong folks


G90 G18 G40 G80 G21
G54
M03 s500
G00 Z50 x23
G00 Z45
G01 X0 f75
G0 Z46 X22
G01 Z45 x21.8
M98 P0002 L32
G90 z46 x22
M05
M30
M99
%



o0002
G91 X-.3
G90
G01 Z30 f100
G01 Z25 X22
G0  Z46 X21.8
G91 X-.3
M99

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Sub programs
« Reply #7 on: May 12, 2016, 07:10:27 PM »
Try it like this

%
O001
G90 G18 G40 G80 G21
G54
M03 s500
G00 Z50 x23
G00 Z45
G01 X0 f75
G0 Z46 X22
G01 Z45 x21.8
M98 P0002 L32
G90 z46 x22
M05
M30

O0002
G91 X-.3
G90
G01 Z30 f100
G01 Z25 X22
G0  Z46 X21.8
G91 X-.3
M99
%
Without engineers the world stops