Machsupport Forum
Mach Discussion => Mach4 General Discussion => Mach4 Toolbox => Topic started by: ahmad1222 on September 15, 2020, 03:42:12 PM
-
hello every one
so my problem is when i call M6 command (lets say the current tool is 1 and i want to change to tool number 2 ) and when it move too return the current tool
and lets say some one accidental press stop the machine will stop and set the current tool to 2 even so it didn't change the tool
is there any thing to tell me that stop is pressed so i can have an if statement to to avoid this
-
You need to put your M6Start.m1s on here for us to look at but rename it to ahmad1222.m1s so you do not get a error message saying already exists.
-
here is the code
-
Hi,
not quite sure what you guys are on about, files of type .m1s are for Mach3. This is a Mach4 board.
Lua source files are of type .mcs and compiled Lua files are of type .mcc.
Additionally its normal in Mach3 to have an M6Start script but not so in Mach4.
If your script is compiled VB then it won't run in Mach4.......Mach4 uses Lua 5.3 for scripting.
Craig
-
The file extension is .mcs then it compiled to .mcc
I program it in Lua
But I upload it with the extension you ask
Last I am working with mach 4
-
My mistake, I was thinking it was Mach3.
-
No Problem so do you have any ideas ?
-
It looks like the macro needs some flags to set as things happen so on exit it knows it completed the change, start a counter as the first thing and then at every stage increment it by 1 for moves open and close tool clamp etc. then when the macro exits check the value and see if its done all the steps.
-
i have try your idea but it doesnt work
as i press stop the tool change the number
i am thinking about to put a code in the PLC Script if the stop pressed and the machine doesn't change the tool it will undo any change