Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: rcaffin on January 02, 2012, 01:03:51 AM
-
Hi all
I will cheerfully admit to all sorts of incompetence, but ...
I have been trying to edit the basic M6End macro (in Mill) to get it to lift the Z axis up clear of the job before making any XY moves. Saves on broken cutters that way.
But despite stopping and reloading Mach many times, it still does not see the modified macro. I've got a M100 message macro inside it as a check; it does not appear and there is no Z-axis movement anyhow. No XY axis movement either, for that matter. Old position is not being restored.
I looked in the Operator pull-down list for the 'view what macros you have loadd' option, but it wasn't there either.
Um ... Help?
And is it OK to use Notepad to edit the m1s files?
Cheers
-
Is it definitely the correct one you are editing? ie the m6end.m1s you re editing is in the macro folder of the profile you are using?
Probably bet to use the editor in Mach itself to edit but I have used notepad as well.
Hood
-
Hi Hood
Yes, I am definitely editing the right one.
How do I know? Because when I tried to use the edited version the system did not 'behave itself'; when I restored the old version (file name change) the system did behave itself (after I had posted). So Mach was seeing the file anyhow. Fortunately I was testing with soft plastic ...
From this I conclude that whatever edits I made caused Mach to reject the modified code ... OK, some progress.
Mind you, while I have been writing Basic for the last ... 30+ years, the inconsistencies in the doco leave me really wondering.
First of all, the M6End.m1s file seems to be written maybe on a Linux machine as it does not use <CR><LF> between the lines. So the file looks a trifle wrong in NotePad, although WordPad manages OK. Read ansd save in Wordpad without any edits and the record terminator changes so that Notepad can handle it. Ah, but can Mach handle both formats? Dunno.
The 'else' clause in M6End.m1s contains this: Code"G00 X" & x & "Y" & y - withOUT any brackets. That is hardly 'Basic'. The example in the Macro Programming Reference doc (Draft rev 0.18) shows (for example) Code(“G00 X-4.000 Y1.000 Z1.000”), with brackets. Conventional basic. I have tried both.
What I did was change the else clause to restore the starting Z position first. So it went from this:
else
Code"G00 X" & x & "Y" & y
end if
to this:
else
code("G0 z" & z)
Code("G00 X" & x & "Y" & y)
end if
In the event, neither G0 instruction seems to have been acted upon.
It's evening here. I will try all this again in the morning using the Mach VB editor, to see whether that makes any difference.
Cheers
-
In General Config, do you have "Stop Spindle, Wait for Cycle Start" selected?
If not, then M6End is not used.
Personally, I use Wordpad for the reasons you stated.
Also note that the current lockdown, 3.43.022, has a nasty M6End bug that can lock up your PC under certain circumstances
-
Easy test is to just send yourself a message in the M6end macro
Message"YEP"
Tha way you KNOW it is being seen at tool change and you have the correct macro.
Just a thought, (;-) TP
-
In General Config, do you have "Stop Spindle, Wait for Cycle Start" selected?
Oh yes, for sure.
3.43.022, has a nasty M6End bug that can lock up your PC under certain circumstances
Not seen that (yet). Details?
Cheers
(More testing after breakfast.)
-
Easy test is to just send yourself a message in the M6end macro
I tried using M100, to no avail. I'll try Message shortly, after breakfast.
Cheers
-
3.43.022, has a nasty M6End bug that can lock up your PC under certain circumstances
Not seen that (yet). Details?
I reported it on the Yahoo group back in March I think, and it was fixed in development version 3.43.028. But the lockdown hasn't changed for about a year so it's still in it I think.
Many different code combinations could cause it. Someone tested and found that if the M6End just contained one line of code with MsgBox() in it it would crash.
-
Progress report.
I saw an error message at one stage saying the Mach had encountered a script syntax error in M6End. It was quickly replaced by other messages, but AHA! Could I see what the syntax error was in M6End? Not chance!
I rewrote the M6End macro from scratch using the Mach VB editor and/or Wordpad and omitting stuff I don't need right now. It now works fine, using either editor. All very strange!
However, attempting to invoke the M100 macro does not work, but maybe that was where one syntax error was.
Code"G00 X" & x & "Y" & y - without any brackets does work (irregular, to say the least!)
Code("G00 X" & x & "Y" & y) - with brackets does work.
Code"g0 x" & x & "y" & y - with or without brackets but with lower case does work.
Can I explain what was going on before? Nope. But I have a working M6 system now (Z lift before XY movement).
Can I find the operator/macros menu item? Nope. Perhaps the manual and the current version differ?
Thanks to all for help.
Cheers
-
What is this M100 macro you keep mentioning? I don't think it's a standard part of Mach3....
Regards,
Ray L.
-
Hi Ray
Geez, I dunno, it must have followed me home one day...
I found it on my system. No idea where it came from.
Basically it is the code found on page 3 of the Macro_Prog_Ref manual:
Dim UsersName As String
UsersName = AskTextQuestion(“Please enter your name:”)
Message “Hello, “ & UsersName & “!”
A simple Message"Hi" would suffice in its place of course.
Cheers