Hello Guest it is April 28, 2024, 06:14:06 AM

Author Topic: Mach4 newbie with questions  (Read 1296 times)

0 Members and 1 Guest are viewing this topic.

Offline Oli81

*
  •  25 25
    • View Profile
Mach4 newbie with questions
« on: March 09, 2022, 11:25:32 AM »
Hello all

After using Mach3 with ESS for a few years, I switched to Mach4 and I think Mach4 is great.

But Mach4 is not Mach3 :)

I set up the machine with all the switches and set the soft limits, so almost done :) Spindle is running and motors are set.

But there are 1-2 things I do not understand or I miss something.
Maybe you can help me.

On the subject of macros:
If I look in the folder profiles in the standard Mach4Mill profile has it there a few macros, including a basic M6 macro and also a file mccLua.mcc. Well, when I create a new profile, then start Mach, I have no macros in the profile folder.
Since I got an error message "Lua:Error occurred while openingfile" I copied the mccLua.mcc file into my folder in my profile.
After that the error message was gone.
I thought ok, then I also copy the two M6 files M6.mmc and M6.mcs into my folder and try to do the macro like in the Mach4 video here:
https://www.youtube.com/watch?v=6-4JkDv9AgM&t=2s
But now suddenly when I start Mach4 it deletes the mccLua.mcc file from my folder and I have the error message again.
So my question, do I have to copy the mccLua.mcc file to my folder when I create a new profile or does it get into my folder somehow else?

I also tried to create a new file in the editor and rewrite the M6 macro, after I debugged it and compile with F7 it does not create a M6.mcc file even after a reboot of Mach4 and when I start Mach4 it gives the error that Mach4 could not load the macro. How do I proceed so that I can create a macro and then in the end 2 files, for example M6.mcs and M6.mcc are in my folder and work?

Can anyone give me a hint here?

Cheers Oli

Translated with www.DeepL.com/Translator (free version)
Re: Mach4 newbie with questions
« Reply #1 on: March 09, 2022, 11:43:38 AM »
before all long explain  ,ill give you one point
after you copy the macro you want ,or delete or what ever you want
open one macro from mach macro debager ,try save and compile
if its not write on bottom successful ,don't try continue because nothing will work as you think

Offline Oli81

*
  •  25 25
    • View Profile
Re: Mach4 newbie with questions
« Reply #2 on: March 09, 2022, 11:57:19 AM »
Ok I'll try this.
 
But about my question, if I creat a new Profil, should then be the mccLua.mcc file in my marco folder or not?

So it can be that a wrong macro is the reason that the lua file is deleted after restarting Mach4?
Re: Mach4 newbie with questions
« Reply #3 on: March 09, 2022, 12:13:37 PM »
No,new profile no macros
Actually it's not full answer because there several default macros exists like M6 ....so only if you created yours you will overide it

Offline Oli81

*
  •  25 25
    • View Profile
Re: Mach4 newbie with questions
« Reply #4 on: March 09, 2022, 12:40:05 PM »
Ok, so also the lua file is not in this folder? Sorry if my questions are stupid after trying since two days to love this problem I‘m may e bit confused🙈
Re: Mach4 newbie with questions
« Reply #5 on: March 09, 2022, 10:08:44 PM »
Hi,
use Explorer or similar to open
c/:Mach4Hobby/Profiles/<YourProfileName>/Macros

There you will see all that there is. If you open the macro editor you will only see the files of type .mcs ie source code files. The other files like .mcc
and .lua files will not open with the editor because they are compiled files.

With a new profile I would expect to see two m6 files, namely an m6.mcs and a m6.mcc, four m162 1n2 m163 files, again  types .mcs and .mcc respectively.

If you have copied any macros into this new profile you will see them as well.

There may not be a mcLua.mcc file at all. This file is generated by gathering up all the macros and other Lua fragments and then compiled. It is this file that runs at runtime.
If you delete it for instance, Mach will look for it,not find it, and so go through the process of gathering all the component Lua parts and compiling it anew.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline Oli81

*
  •  25 25
    • View Profile
Re: Mach4 newbie with questions
« Reply #6 on: March 10, 2022, 12:27:02 AM »
Hei Craig

Thanks for your reply

Yes I know this about the folders and how to look, I was only wondering when I creat a new profile why the macro folder is empty and not filled with the, would say „basic“ scripts like in the default profile like Mach4mill.

Your answer about the lua file is that what i was looking for. So this file will not be created automatic with a new profile it will be created after.

Another question, for exp. I would like to creat a new macro, do I have to do this direct in Mach4 in the Editor and after I debugging it and compile it, Mach4 should generate the .mcc file of it automatic and then they are at thr end a .mcs and .mcc file with the same name in the folder right?
Re: Mach4 newbie with questions
« Reply #7 on: March 10, 2022, 12:29:20 AM »
This mach main idea  I think ,it's platform not final solution,this the reason I choose mach,so you can create all yours macro
Re: Mach4 newbie with questions
« Reply #8 on: March 10, 2022, 12:31:14 AM »
One point need remember,mach will create one file with all m function inside ,it's mean you not allow use same function name in 2 macros ,if you do so you will get unexpected step

Offline Oli81

*
  •  25 25
    • View Profile
Re: Mach4 newbie with questions
« Reply #9 on: March 10, 2022, 01:15:21 AM »
Hello all

Thanks for your support.

Yes, same me, I saw the possibilities to create own macros and learn more about Lua.
About Mach4 create one file with all m functions inside, so if I want to create a new macro for m6, how do I have to go for it?

My Idea with Mach4 was to set up all my machines like this:
Set the spindle nose, so no bit inside as tool 1, or master tool and reference all tools with an offset to this length with the tool height offset.

Also my 3d touch probe, let’s say as tool 99 and a simple M6 macro who just stop the job, move to a tool change location, wait for the tool change and after continue the job.

So I could use my tool 99 to set the X Y Z reference and from there on work only with the offsets.
I don’t think this should be complicated, or is my thinking wrong?

I looking forward to learn more about the possibilities of Mach4 and trying out new thing, but at the moment I’m in the middle of a project and need the machine to work.

And yes, I know, it was not the best idea to change to machine software in the middle of a project but after Mach3 did it again and destroyed my parts with doing some things on his own, even I did this part many times before with the same code, I wanted to change it.