Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: JJ on May 11, 2007, 02:58:23 PM

Title: M99, M98 problems...
Post by: JJ on May 11, 2007, 02:58:23 PM
Hello,

After searching every post with "M99" in it, I still can't find an answer to my problem.

I'm having trouble calling a .tap file with the M99 command.

The following is in a .tap file called Main.tap located in c:\mach3\gcode:

G28.1 Z0 Y0 X0
M99 (Sub.tap) L1
M30

The following is in a .tap file called Sub.tap located in c:\mach3\gcode:

G0 G49 G40 G17 G50 G90
G82 X0 Y0 Z-.01 P0 R-.001 F150
X1.53 Y3.1 Z-.42
M99
%



When I try and load Main.tap, it doesn't load and the GCode display doesn't change.

Please help!

Thanks,

JJ
Title: Re: M99, M98 problems...
Post by: Graham Waterworth on May 11, 2007, 05:01:37 PM
To call a sub you use M98

e.g. M98 P1001

M98 (sub.tap)

Graham.
Title: Re: M99, M98 problems...
Post by: Graham Waterworth on May 11, 2007, 05:04:32 PM
Have a look at this post, its important to use wordpad to create the subs.

http://www.artsoftcontrols.com/forum/index.php?topic=2540.0

Graham.
Title: Re: M99, M98 problems...
Post by: JJ on May 12, 2007, 12:24:08 PM
Thanks Graham,

The M99 was a typo in my post... I was using M98 to initiate the canned scenario.

I'll try using wordpad when I get back to work on Monday.  I'll post the results.

Thanks again,

JJ

Title: Re: M99, M98 problems...
Post by: JJ on May 15, 2007, 03:04:25 PM
OK...

I tried saving the sub.tap file and the main.tap file from Wordpad using the "Text Document - MS-DOS Format" option in the save-as function as per the link above.

I still see no G-Code in the G-Code display of the program when I do File - Load G-Code - Main.tap from the C:\mach3\gcode folder.

I did find an additional problem that could be an indicator to the cause of this.  When I try and edit a newly taught file via a Button defined as "Edit File" in the OEM drop down list, it does not launch my text editor.  I did a search through the forums and found people with similar issues having the wrong setting in the General Config options.  I verified that my path in that setting is c:\program files\windows nt\wordpad which I defined using the "Browse" button.  It still doesn't work.  I also tried defining the path to notepad from here and it didn't work either.  Do I have a system variables issue in Windows?

Any help is greatly appreciated.

Thanks,

JJ
Title: Re: M99, M98 problems...
Post by: Graham Waterworth on May 15, 2007, 04:55:26 PM
Hi JJ,

email me your files and I will try to load them on my setup.

Graham.
Title: Re: M99, M98 problems...
Post by: JJ on May 15, 2007, 05:48:18 PM
Files sent... thanks again.

JJ
Title: Re: M99, M98 problems...
Post by: Chip on May 15, 2007, 06:43:10 PM
Hi, JJ

I think your Sub files need to be in " C:\Mach3\Subroutines\ " Folder.

The following is in a .tap file called Main.tap located in c:\mach3\gcode\

G28.1 Z0 Y0 X0
M98 (Sub.tap) L1
M30

The following is in a .tap file called Sub.tap located in c:\mach3\Subroutines\

G0 G49 G40 G17 G50 G90
G82 X0 Y0 Z-.01 P0 R-.001 F150
X1.53 Y3.1 Z-.42
M99
%

Works Hear !

Hope this Helps, Chip





 
Title: Re: M99, M98 problems...
Post by: JJ on May 16, 2007, 01:45:20 PM
Thanks to all that have helped so far... I'm still not out of the woods though.

I was able to get the file to load by placing the sub.tap file in c:\mach3\subroutines.  However this creates a new problem.

How can I teach and endteach a file in the subroutines folder?  I've tried the following to no avail.

OpenTeachFile "c:\mach3\subroutines\sub.tap"

and

OpenTeachFile ("c:\mach3\subroutines\sub.tap")

and

OpenTeachFile (c:\mach3\subroutines\sub.tap)


After failing at this, I figured I'd teach it to the default c:\mach3\gcode folder using OpenTeachFile "sub.tap" and try Graham's email suggestion to M98 (c:\mach3\gcode\sub.tap) L1 but of course that fails to load the file giving me the same indications as above.

I guess that brings me back to how I can teach a file to the subroutines folder.

Thanks for all your help so far guys... I am at my wits end here. :)

JJ
Title: Re: M99, M98 problems...
Post by: Chip on May 16, 2007, 09:29:56 PM
Hi, JJ

Use the Teach feature, It Saves it to C:\Mach3\Gcode, You will have to Edit it anyway to add the M99, Use the File, "Save As" and Save it to the C:\Mach3\SubRoutines\, Folder.

On the Edit Problem, Try this "C:\WINDOWS\notepad.exe", Works Hear for Me.

Hope this Helps, Chip


Title: Re: M99, M98 problems...
Post by: JJ on May 17, 2007, 01:21:44 PM
Use the Teach feature, It Saves it to C:\Mach3\Gcode, You will have to Edit it anyway to add the M99, Use the File, "Save As" and Save it to the C:\Mach3\SubRoutines\, Folder.

Hi Chip,

Thank you for your reply.  Unfortunately this is the exact thing I'm trying to automate using VB.  Adding the M99 through VB is not a problem, but the mandate that subroutines be in the subroutine folder makes the teach function useless for subroutines as it only teaches to the gcode folder.  This wouldn't be a problem if m98 could call a file from the gcode folder, but that doesn't seem to be the case.  This screen is being made for internal customers and I would really like for them not to have to move a subroutine file every time they "teach" a new one.  Has nobody had the need to do this before?  I would think someone is using the teach function for subroutines as well as main routines, but I could definitely be wrong and probably am. :)

Is this the type of thing we ask Art to implement into his next version?

Thanks again for everyone's help...

JJ
Title: Re: M99, M98 problems...
Post by: Chip on May 18, 2007, 05:05:03 PM
Hi, JJ

I think the Wizards are in VB and can be modified, Look under M<ach3, Addons folder then Teach.

Should be able to modify there ?

Hope this Helps, Chip
Title: Re: M99, M98 problems...
Post by: ChrisLT on February 21, 2008, 07:32:15 PM
Chip,
I've just been struggling with these same problems, so found this discussion very helpful. Thank you. The documentation doesn't say that subroutines have to go in a special folder. I'd totally forgotten there is such a folder. Also, it doesn't say whether the subroutine needs to end with M99. Frankly, it seems daft that you need an M99. End of file should have the same effect.
Regards
Chris
Title: Re: M99, M98 problems...
Post by: Chip on February 21, 2008, 10:30:11 PM
Hi, Chris

The M98 & M99 work together M98 (Subfile 1.tap) L10 ,(Calls (Subfile 1.tap), The M99 returns it to M98 till the L10 repeats 10 times then M30 end's it and return to top of the code


G28.1 Z0 Y0 X0
M98 (Subfile 1.tap) L10 (Calls (Subfile.tap) 10 times
M30

The following is in a .tap file called Subfile 1.tap located in c:\mach3\Subroutines\ and is repeated 10 times

G0 G49 G40 G17 G50 G90
G82 X0 Y0 Z-.01 P0 R-.001 F150
X1.53 Y3.1 Z-.42
M99 (Without the M99 the file wouldn't repeat and Just end.)
%

Hope this Helps, Chip