Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: guynamedbathgate on January 12, 2007, 09:59:35 AM

Title: its gonna be one of those days.
Post by: guynamedbathgate on January 12, 2007, 09:59:35 AM
now i will dmit im new at this. but i had this program working fine a few months ago. now for some reason the controller wont recognize my subprograms. it just skips over them. can someone load this and see if Im doing something wrong. its pretty much my first real attempt at writting a program so be gentle pkease. ;)
Title: Re: its gonna be one of those days.
Post by: Scott on January 12, 2007, 12:17:42 PM
Hi guynamedbathgate,

You need to remove the line number in front of the sub routines and it should work then.  The O line cannot have a line number.

Regards,
Title: Re: its gonna be one of those days.
Post by: guynamedbathgate on January 12, 2007, 12:38:06 PM
yep that was it.
wonder how it even worked before?
thanks anyway. I promise ill never do it again. :P
Title: Re: its gonna be one of those days.
Post by: Sam on March 03, 2008, 02:03:57 PM
I have the same problem with version 3.037.  Version 3.032 works fine though.
Sample--2 simple squares.
Any help is appreciated.

G90 G01 X0.0 Y0.0 F1000
M98 P1
M98 P2
M30
O1
X0.0 Y0.0
X1.0 Y0.0
X1.0 Y1.0
X0.0 Y1.0
X0.0 Y0.0
M99
O2
X2.0 Y0.0
X3.0 Y0.0
X3.0 Y1.0
X2.0 Y1.0
X2.0 Y0.0
M99
Title: Re: its gonna be one of those days.
Post by: Graham Waterworth on March 03, 2008, 04:55:56 PM
Always make sure you have a return on the last line, that is the most common cause of non running subs.

Putting a % at the start and end of the programs helps.

Graham.

%
G90 G01 X0.0 Y0.0 F1000
M98 P1
M98 P2
M30

O1
X0.0 Y0.0
X1.0 Y0.0
X1.0 Y1.0
X0.0 Y1.0
X0.0 Y0.0
M99

O2
X2.0 Y0.0
X3.0 Y0.0
X3.0 Y1.0
X2.0 Y1.0
X2.0 Y0.0
M99
%
Title: Re: its gonna be one of those days.
Post by: Sam on March 03, 2008, 05:15:35 PM
Still a no-go.
Title: Re: its gonna be one of those days.
Post by: vmax549 on March 04, 2008, 12:28:11 PM
COuld it be that your are using an OH instead of a ZERO???
Title: Re: its gonna be one of those days.
Post by: Overloaded on March 04, 2008, 12:36:13 PM
should be OH...shouldn't it ?
Title: Re: its gonna be one of those days.
Post by: Graham Waterworth on March 04, 2008, 12:41:50 PM
Add the red bits and it works, I don't know what has changed in Mach .037 but I will have a word with Brian about it.

Graham.

%
G90 G01 X0.0 Y0.0 F1000
M98 P1 L1
M98 P2 L1
M30

O1
X0.0 Y0.0
X1.0 Y0.0
X1.0 Y1.0
X0.0 Y1.0
X0.0 Y0.0
M99

O2
X2.0 Y0.0
X3.0 Y0.0
X3.0 Y1.0
X2.0 Y1.0
X2.0 Y0.0
M99
%
Title: Re: its gonna be one of those days.
Post by: Sam on March 04, 2008, 01:26:29 PM
Thank you Graham. Works great. How you figured that one out I'll never know.
Title: Re: its gonna be one of those days.
Post by: vmax549 on March 04, 2008, 01:50:46 PM
YEP you are correct. OH it is(;-)

(;-) TP
Title: Re: its gonna be one of those days.
Post by: Graham Waterworth on March 04, 2008, 03:26:16 PM
Not just a pretty face, or is that not a pretty face.  ;D

Graham.
Title: Re: its gonna be one of those days.
Post by: Brian Barker on March 05, 2008, 02:19:04 PM
I added code to tell Mach not to run a sub if thre is an L of 0 and looks like the default is 0 not and not 1 :( . I will see if I can change that :)
Thanks
Brian