Hello Guest it is December 15, 2019, 09:24:34 AM

Author Topic: M6 script does not seem to take changes  (Read 209 times)

0 Members and 1 Guest are viewing this topic.

M6 script does not seem to take changes
« on: March 12, 2019, 02:26:10 AM »
I edit the M6.mcs script it compiles ok  all I am doing for a start it to alter the x y z positions to see if the changes take place  it does not the machine still runs to x 12 y 5 etc not the new position I have put in I have restarted mach4 as I think it re includes and compiles as it starts but does not seem to use what I have edited in  I use a different tool number in the MDI each time but it still goes to the original position in the script that was there before the edit
any idea's
Re: M6 script does not seem to take changes
« Reply #1 on: March 12, 2019, 02:48:00 AM »
Hi,
what did you name your macro? If you named it M6 then I would expect it to fail.

Mach4's Gcode interpreter converts all Gcode to lowercase and strips out the leading zeros, thus:
M6
m6
m06
and
M06
all get treated the same because Windows file names are case insensitive. Not withstanding that case insensitivity
there are occasions when it does create an error, and I think you have found one.

All Gcode, including m codes, should be lowercase and without leading zeros.

When you rename your macro make sure you delete the existing ****.mcc files. If Mach finds an appropriately named
***.mcc file it wont bother to compile a fresh one from the ***.mcs file.

There are two interpretations of  the T word in a line of Gcode.

m6 t5........you might expect that after the tool change tool 5 would be in the spindle. This is the common interpretation
and is familiar to us from Mach3. However in industrial machines another interpretation is possible and even desirable.
That interpretation is that tool 5 is the tool to be installed into the spindle at the NEXT tool change. This would mean
that tool carousal is ready and waiting and therefore the tool change is quicker.

Configure/Control/Tools per the attached pic.

Craig
My wife left with my best friend...
     and I miss him!
Re: M6 script does not seem to take changes
« Reply #2 on: March 12, 2019, 05:36:00 AM »
Hi
I had several versions of m6,mcs even though they were renamed they started with m6 deleted them and now changes take place I thought I could rename then and keep backups but you need to have some where other then the macro directory
thanks for the help
Regards Ray
Re: M6 script does not seem to take changes
« Reply #3 on: March 12, 2019, 06:11:22 AM »
Hi,
when you call a m code Mach has a search path and it uses the first valid file it finds. That is why its essential
to use the correct naming strategy. What you have described is that Mach has found a compliant m6 file BEFORE
it got to the one that you intended.

Craig
My wife left with my best friend...
     and I miss him!

Offline Chaoticone

*
  • *
  •  5,634 5,634
  • Precision Chaos
    • View Profile
Re: M6 script does not seem to take changes
« Reply #4 on: March 12, 2019, 08:31:39 AM »
And if you rename the macro file but leave it in the macros folder, it still gets compiled into the Lua.mcc chunk. So, name the files what ever you want but if you have multipul m6 functions rolled into the Lua.mcc......... guess which one runs each time you call it.

So, don't have anything you don't want as a macro in the macros folder. Also delete all .mcc files (assuming you have the source code of course) in the macros folder after editing any macro. This will force a new compile insuring any changes you made show up.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: M6 script does not seem to take changes
« Reply #5 on: March 12, 2019, 01:32:37 PM »
Hi,

Quote
Also delete all .mcc files (assuming you have the source code of course) in the macros folder after editing any macro.

I don't find this necessary if I'm using the Zero Brane editor to make the changes. If any change is made (using the editor)
the file is flagged as changed and therefore will be recompiled. If it is recompiled the .mcc is overwritten, it is not necessary
to explicitly delete it.

Craig
My wife left with my best friend...
     and I miss him!
Re: M6 script does not seem to take changes
« Reply #6 on: March 12, 2019, 06:33:27 PM »
I remember the old Lua Editor we used to have in Mach was temperamental, if I made certain changes to a macro, I had to delete all the .mcc files otherwise it acted as if I had made no changes.  Thankfully the Zero Brane editor works MUCH better!!
Chad Byrd