Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: BlackElle170209 on November 29, 2015, 10:39:15 PM

Title: M06 not working
Post by: BlackElle170209 on November 29, 2015, 10:39:15 PM
M06 doesn't halt program and stop for the tool to be changed.......................M06 command is basically ignored by M4, when Gcode is run. (M01 operates OK).
Also The tool Change LED in the prog run window never illuminates.

Interestingly the above applies to 3 different computers, M4: Version 4.2.0.2803 -  2 unlicensed computers (Demo) running the simulator (Win10 X64)  and my licensed workshop Machine OS XP SP3 with parallel port and Darwin.
 A M6 macro is installed in Macros under the machine Profile - (all machines).

 I can see no reason for the command to be ignored - as far as I can tell the M06 Lua code runs OK, (but I'm very much a learner with this)...............the other thought  perhaps  the Mach4 configuration is not setup correctly - which could be the case, as no one else seems to having the same problem.
  I'm totally at a loss as to what to try next!.

Their is a tool change option in the output Tab of  M4 config - is this meant to be set somehow (I have tried all sorts of combinations but with nil result so far.
Does anyone know what is wrong and/or what the fix might be? (Mach3, M06 stop and  tool change works fine).

Thanks for any advice/help
Richard 
Title: Re: M06 not working
Post by: dude1 on November 29, 2015, 11:10:36 PM
can you post your .ini file it's in your profile folder
Title: Re: M06 not working
Post by: BlackElle170209 on November 30, 2015, 06:47:31 PM
Hi blockhead

file attached

thanks for responding

Richard
Title: Re: M06 not working
Post by: dude1 on November 30, 2015, 11:35:14 PM
seen that before I had the same thing just needed your .ini to check, re install as admin should fix it, or try run as admin first
Title: Re: M06 not working
Post by: BlackElle170209 on December 01, 2015, 12:43:10 AM
Many thanks for that...................I'll check it out tomorrow. It's quite likely that Mach4 was not installed with admin. My original computer died a few weeks back and a second spare computer was temporarily employed. Licensing had to be changed of course, then the existing computer hardware was completed and put into service - new licensing required again..........so lots of messing around to get to the present point in time.

Thanks again will advise success.

Richard
Title: Re: M06 not working
Post by: dude1 on December 01, 2015, 01:12:43 AM
cool
Title: Re: M06 not working
Post by: BlackElle170209 on December 03, 2015, 08:12:32 PM
Hi blockhead

Unfortunately no success using Adminstrator as login.
 Tried reinstalling as Administrator but no change.
 
What I have found is that the .ini file is not being copied to. Getting the following errors reported:

Error
Failed to modify file times for "(error 0: the operation completed successfully).
Details:
x Failed to copy the file c:\mach4Hobby\Profiles\SeigX2-6\machine.ini to
error 0 : the operation completed successfully)
x Failed to open for writing for "(error 0: the operation completed successfully).
x Failed to modify file times for: for "(error 0: the operation completed successfully).

Do you know if this is a windows OS problem or M4 problem................any ideas?
All help, ideas, gratfully received...................

Richard
Title: Re: M06 not working
Post by: DazTheGas on December 04, 2015, 03:35:24 AM

Unfortunately no success using Adminstrator as login.
 Tried reinstalling as Administrator but no change.

have you tried right clicking on mach4 and using the Run As Administrator from the context menu,

Daz
Title: Re: M06 not working
Post by: dude1 on December 04, 2015, 03:57:26 AM
try what daz suggested first, try running version Build 2336 you can get it here http://www.pmdx.com/Downloads_Mach4/Mach4_Hobby_Releases/, if this version works reinstail 2803, and if it fails again you may just have a dependicey missing.
if it fails can you run logging as soon as M4 loads up before you hit enable and run a gcode if it blows past M6 again just stop it and save the logging and post it with your .ini again, also submit it to mach support 
Title: Re: M06 not working
Post by: DazTheGas on December 04, 2015, 04:08:23 AM
just out of curiosity open up your m6 macro the function is declared as function m6() but should be function M6() in capital.

I have had this cause a problem before as lua is case sensitive.

Daz
Title: Re: M06 not working
Post by: Chaoticone on December 04, 2015, 08:19:35 AM
Are you using a custom profile or one of Machs default profiles? I would try one of the unaltered defaults and see if it works in it. Lots of changes to the default profiles (ini) that yours may not have. 
Title: Re: M06 not working
Post by: dude1 on December 04, 2015, 03:46:33 PM
its a custom one
Title: Re: M06 not working
Post by: BlackElle170209 on December 05, 2015, 11:04:00 PM
Thanks to everyone for the suggestions

So far have been able to eliminate the error messages -  seems it was caused by the windows date somehow reverting back to the start up time of the new/old  MB - probably occured when I  replaced the battery on the MB, but I do remember resetting the date and time after the change.
No impact on the M06 problem though.
I'm fairly confident that the .ini file is now being updated correctly.

Previously I'd started reading/learning Lua, so I'd already looked for syntax errors in the M6 macro, with no luck there. Also logging on, reinstalling with administrator rights - no luck there either.
The M4 history logging is great - attached is a log from the machine running a short section of GCode that has a couple of M06 commands in it - (V 2803).
From what I can determine from the log, it seems to me that Mach4 is working correctly.  I'm now thinking that the machine configuration setup is not correct and/or the maping is incomplete somehow ...............but I could be wrong.

Have now just completed retesting with M4 version 2336 as blockhead suggested. Result however is the same  - no stops for M6.  When compared, Machine and history log files for both Versions 2336 and 2803 are essentially the same
  So I'm now at the stage where I'd really appreciate it if someone with much greater knowledge could have a look at the attached log and machine file and see what they can determine from it before I annoy mach support.
Having a reference or generic machine file that is known to work  (to compare inputs/outputs that have been enabled or not etc) would be very helpful. Attached is the log file for V2803 and machine.ini file.

 Once again thanks in advance for suggestions and help.

 
Title: Re: M06 not working
Post by: dude1 on December 05, 2015, 11:58:59 PM
your machine2, shows you have ESS and sim plug you don't want these two in there if you're running darwin, sim can cause problems.
 
it also comes up with this
[ToolChangeSettings]
ToolChangeMsgBox=0
and
M6=155

are you loading the .ini file up from a clean install, or are you adding it to a profile. or are you starting with a clean profile what is a copy of Mach4Mill what you name then you do all the settings and install the needed plugin and removing sim, and have you checked that M6 is in the macro folder under your profile name.

straight out doing a clean install not setting any setting at all and adding no plugins does this problem still happen, it should not, this will give you a logging of what should happen with a manual tool change
Title: Re: M06 not working
Post by: DazTheGas on December 06, 2015, 03:04:29 AM
As blockhead says, do a clean install and use all defaults (default profile) and the sim as the motion controller then try, if all is ok then you can add bit by bit,

Daz
Title: Re: M06 not working
Post by: BlackElle170209 on December 07, 2015, 03:23:36 AM
Success..............M06 macro is now working.

Interestingly, the keyboard is working correctly now, also probing appears to now work (correctly!). Don't know what was going on before................

Basically, as suggested, I deleted all of Mach4 including profiles, and reinstalled and setup from scratch. Got the sim plugin only working and tested, then installed, configured Darwin and Mach4 - testing at each step and loging results. Finally a full test.

Thanks blockhead, Daz and others for suggestions and time - I greatly appreciated your feedback.This forum is definately a great resource.

Richard
Title: Re: M06 not working
Post by: dude1 on December 07, 2015, 01:47:13 PM
good stuff have fun
Title: Re: M06 not working
Post by: AA1PI on January 21, 2016, 03:23:18 PM
I have the same problem M06 ,  when I run this test code it only stops after M30

G0G90G54G17G40G49G80
G0X4.0Y0.0Z1.0T1
M6
G0X10.0Y-5.0Z1.0
T2M6
M30


I have read the other posts tried the run as admin, has anyone solved the problem?
Title: Re: M06 not working
Post by: dude1 on January 21, 2016, 04:13:00 PM
make sure the M6 macro starts with M not m
Title: Re: M06 not working
Post by: AA1PI on January 21, 2016, 04:24:27 PM
The M6 Macro is found ?   I don't have it in my Macro folder
Title: Re: M06 not working
Post by: dude1 on January 21, 2016, 04:31:53 PM
C:\Mach4Hobby\Profiles\Mach4Mill\Macros
Title: Re: M06 not working
Post by: AA1PI on January 21, 2016, 08:38:08 PM
I need to provide more information, I noted you referenced  C:\Mach4Hobby\Profiles\Mach4Mill\Macros     if I use MACH4MILL profile on a DEMO of MACH4 the M06 sinipit works as it should.
 I am using a PMDX-410  and the setup files for the profile VER. 0.33.159  running on the latest version of MACH4    when I run code containing  M06 it continues over the code and does not pause for the tool change. I am going to post on  PMDX  or maybe Steve Stallings will see this here. I will give things a chance to shake out an answer.  I also used profile  MACH4_6axis the code worked with it also.

G0G90G54G17G40G49G80
G0X4.0Y0.0Z1.0T1
M6
G0X10.0Y-5.0Z1.0
T2M6
M30

Thanks    AA1PI
Title: Re: M06 not working
Post by: bob_at_pmdx on January 22, 2016, 12:05:19 AM
If you are using a profile based on the PMDX-Sample profile that is (optionally) installed with the PMDX-SmartBOB plug-in, then the M6 macro is not there (an oversight on my part).  You can copy the m6.mcs file from:

     C:\Mach4Hobby\Profiles\Mach4Mill\Macros\m6.mcs

into the "Macros" sub-directory in your current profile.  For example, if you are using the PMDX-Sample, copy it to:

     C:\Mach4Hobby\Profiles\PMDX-Sample\Macros\m6.mcs

You may optionally also copy the "m6.mcc" file.  But if you don't, Mach4 will create it the next time it runs.  The "mcc" file is the compiled version of the "mcs" file.

CAUTION: **IF** you are using the PMDX-Sample profile, please copy it to a new profile name.  A future version of our installer *MAY* overwrite that directory (though we will always give you a warning before we do it).  To copy the profile, start the Mach4 loader, click once on the PMDX-Sample then click on the "Copy Profile" button.  Give it a new name.  You can leave the "Screen Set" field blank and it will keep the existing screen set.
Title: Re: M06 not working
Post by: AA1PI on January 22, 2016, 10:16:13 AM
Thanks Bob,
   I had a renamed copy already so I did a copy and paste of the M6 files to the macro dir,
and tested it, works as it should.
    I hope this thread will help others.      M06 success    PMDX- 410   a few words for the search engine

     Many thanks to all      Bob,     AA1PI
Title: Re: M06 not working
Post by: PhilCNC on January 30, 2016, 08:13:13 PM
Note that the official Lua Scripting manual does contains errors related to the name of the M6() function. In the manual, section 5.4 (page 22-23) , its shown that the tool change Macro can be customized using the m6() function. This is INCORRECT because Lua is has case sensitive functions. You need to use the M6 function name (uppercase).

It's really unfortunate that the official manuals still contains errors.
Title: Re: M06 not working
Post by: bob_at_pmdx on January 30, 2016, 09:21:24 PM
Note that the official Lua Scripting manual does contains errors related to the name of the M6() function. In the manual, section 5.4 (page 22-23) , its shown that the tool change Macro can be customized using the m6() function. This is INCORRECT because Lua is has case sensitive functions. You need to use the M6 function name (uppercase).

It's really unfortunate that the official manuals still contains errors.
I know that others have had issues with upper/lower case.  However, when I copy the stock m6.mcs file from the Mach4Mill profile, which has both the file name and the macro function name defined in lower case "m6", into my SmartBOB test profile, it works.  At least with MDI code.  With either "m6" or "M6" in the MDI window.

Perhaps I've got to go back and find/read the thread that talked about case sensitivity.

Bob
Title: Re: M06 not working
Post by: shandseimela@gmail.com on December 07, 2021, 08:21:13 AM
Note that the official Lua Scripting manual does contains errors related to the name of the M6() function. In the manual, section 5.4 (page 22-23) , its shown that the tool change Macro can be customized using the m6() function. This is INCORRECT because Lua is has case sensitive functions. You need to use the M6 function name (uppercase).

It's really unfortunate that the official manuals still contains errors.
I know that others have had issues with upper/lower case.  However, when I copy the stock m6.mcs file from the Mach4Mill profile, which has both the file name and the macro function name defined in lower case "m6", into my SmartBOB test profile, it works.  At least with MDI code.  With either "m6" or "M6" in the MDI window.

Perhaps I've got to go back and find/read the thread that talked about case sensitivity.

Bob
I had this error C:\Mach4Hobby\Profiles\Mach4Lathe\Macros\m6.mcc could not be found , after i changed from m6 to M6 the error disappeared