Hello Guest it is April 26, 2024, 05:34:24 PM

Author Topic: Mach3 Random M98 Behaviour  (Read 12272 times)

0 Members and 1 Guest are viewing this topic.

Mach3 Random M98 Behaviour
« on: May 03, 2006, 10:16:14 PM »
Hi,

I am experiencing seemingly random behaviour of the M98 sub routine call. The subroutine is contained within the same file as the calling M98 command. Sometimes it will call it OK and the correct number of times and then sometimes not. Usually after adding another block of code somewhere else. Not obviously related to where the problem shows up. I have noticed that if I delete some comment blocks towards the start of the program after the problem starts it will sometimes start working again. Add a comment somewhere and it stops.

Example:

%Main Program
G0 X0 Y0
M98 P4100
M30
% Sub routine
o4100
G1 x1 y1
M99

A number of programs share similar random behaviour. They are in the order of 200 to 300 line in total. This is running on a liceneced Mach3 Version D1.90.020 something through to 32.

Has anybody got any ideas what might be causing this.
Re: Mach3 Random M98 Behaviour
« Reply #1 on: May 04, 2006, 07:01:15 AM »
Take out the "%" They are not used in Mach3. See if that helps at all.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Mach3 Random M98 Behaviour
« Reply #2 on: May 04, 2006, 09:26:53 AM »
Ok, I will give that a try. What comment character is used in MACH3?

Should it be // or something else?

Steven
Re: Mach3 Random M98 Behaviour
« Reply #3 on: May 04, 2006, 10:38:19 AM »

So I discovered // isn't a comment inMach3. I put all comments in brackets (comment open & closed bracket on each line ). Exact same behaviour as with % character starting a comment.

Is there any other way to comment?

Steven

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Mach3 Random M98 Behaviour
« Reply #4 on: May 04, 2006, 07:08:10 PM »
Hi:

 Use an L param. Ill check the problem but adding an L1 to the sub call will make it call only once...

Art
Re: Mach3 Random M98 Behaviour
« Reply #5 on: May 05, 2006, 12:06:07 AM »

Thanks Art,

I think I might have a couple of M98s that don't have the L1 on them. Most do, I will check, probable not 100% consistent on this. I have also had the problem occur when I had an M98 P1000 L14 and it started to just call it once.

Actually it was more like
#100=[2*7]   (something like this to document what I was doing)
G code and then...
M98 P1000 L#100
M30
O1000
G Code
M99

I have also had code that worked like this for a while and then stopped

#20=1000
lines of G code and then...
M98 P#20 L1
M30
O1000
lines of G code and then...
G Code ....
M99

I use this kind of thing where I have multiple fixtures with the same part and I can get the more parts made per tool change.

Certainly appreciate you looking at it.

Steven
Re: Mach3 Random M98 Behaviour
« Reply #6 on: May 05, 2006, 12:13:28 AM »
Art,

I checked the file and added some L1s where they where missing. So each M98 has an L command. Same, this didn't stop it calling the an L14 only once. It made no difference if it was L14 or L#100 where #100=14 either.

Steven
Re: Mach3 Random M98 Behaviour
« Reply #7 on: May 09, 2006, 03:36:50 AM »
I'm also getting this behavior - code that ran well on Mach 2 is now totally dead. I've got several forms of M98 calls, and none are operational. My Mach3 is Version R1.84.001.

For example:

#50=3
M98 P[40+#50]

or
M98 P53

or
M98 P53 L1

Strangely, this one slowed the machine down greatly, but didn't actually make it render the tool path or run the subroutine:
M98 P[40+#50] L1

None are entering the subroutine. I don't want to strip all comments from the code, but am beginning to consider it. I've been using the same gcode for quite some time, and this is maddening. I've got all comments clean (in parentheses) - Mach 3 does not like mismatched parentheses at all, nor does it like nested ones.  Any thoughts?

-- Rob Ferber

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Mach3 Random M98 Behaviour
« Reply #8 on: May 09, 2006, 08:03:25 AM »
Hi ROb:

  I just tested the following in 1.90 , Ill have to test 1.84 later today for it. 1.90 responds fine to

#50=3
M98 P[40+#50] L1
G0X0
M30

O43
G1X10
M99


Thanks, Ill let you know what I find in 1.84

Art
Re: Mach3 Random M98 Behaviour
« Reply #9 on: May 09, 2006, 03:52:32 PM »
I've been cutting progressively more out of my code to get something that renders identically under Mach2 and Mach3, and finally have something.

First, there was a typo in my code. A single line contained the error:
#137=#137+1

instead of
#137=[#137+1]

With this fixed, it will enter the first subroutine, but not call any of it's secondary subroutines. Mach2 never glitched on this line (perhaps it should have? what is the rule for math expressions in parameter assignments?).

I have rechecked all comments, and they conform to the (...) format, without enclosed parentheses. If I stip all blank lines, inline comments, and comment lines from the code, then it renders in Mach3 as it did in Mach2.

It would be nice to be able to leave comments in the code - requiring impenetrable coding practices is perhaps itself not a best practice.

I've upgraded to 1.90.035, though the behavior seems unchanged from 1.84.001

Thanks,

-- Rob