Hello Guest it is March 29, 2024, 07:51:09 AM

Author Topic: Using macros in mach4  (Read 2218 times)

0 Members and 1 Guest are viewing this topic.

Using macros in mach4
« on: July 26, 2019, 11:27:23 AM »
Hello everyone,

I have used mach4 and mach3 to make some CNC routers for wood, now I'm working in a retrofit project for a NISSHIMBO puch press machine, I'm going to replace all the servomotors, computer and the old control card, the thing is this machine have some customized Gcodes used to make some routines, and my customer asked me to have the same Gcode functions in the new system. As mach4 does not have such customized Gcodes, I want to know if there is any way to program or modify these Gcodes, or how can I use macros to simulate these routines.

Best regards.
Re: Using macros in mach4
« Reply #1 on: July 26, 2019, 02:11:07 PM »
Hi,
you cannot write or edit Gcodes. Gcode is an industry wide machine control language.

You can write macros however. They will each have a name like m100, m105, m120 etc. These can then
be used throughout the Gcode program.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Using macros in mach4
« Reply #2 on: July 26, 2019, 03:51:46 PM »
Hello Craig,

thanks for your kind reply,

That is something I was afraid of and now I want to know if my best option for this project is to use mach4 hobby or industrial license, wich one woul offer me the best resources for this application?
as my customer does not have Cam software to make postprocessing of their files for the punching machine, they want to have the posibility to design and edit the models directly with mach4, I was thinking in something like a customized screen using buttons to edit a Gcode file, I believe this is a good option but don't know if it requires so much skill to do.
Re: Using macros in mach4
« Reply #3 on: July 26, 2019, 05:24:35 PM »
Hi,
you can use either Hobby or Industrial.

The main advantage of Industrial is support. With Industrial if your customer has a problem they can ring or Email NFS
and anticipate support, with Hobby support is the forum or the ticket system. The ticket system is good but can
be lengthy, NFS staff get to it on an 'as available' basis.

It sounds like your customer is not CNC savvy. The method you are talking about is much like 'conversational programming'
or in Mach terms 'wizard programming'. In this instance I thin you will have to write the wizards. I suspect that will be
a challenge.

May I suggest downloading NFS Mill Wizard. It is a standalone program that allows you to stand at your machine and
chain together various simple operations (tool paths) that make up a job. No CAD or CAM required. It may give you
a glimpse about what such a program can offer.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Using macros in mach4
« Reply #4 on: July 26, 2019, 06:28:40 PM »
Hi,

I'm not as far of getting it as I thought, I was researching for some time but at this point a guide or example of how to make a wizard from scratch would be very useful.
I'll be using mill wizard as reference to work
Re: Using macros in mach4
« Reply #5 on: July 26, 2019, 06:48:55 PM »
Hi,
a very useful example of a module which contains a visual pane to prompt the user to make suitable location choices
is the touch off module. Mach4Hobby/Modules/mcTouchOff.lua

Note the file is all in Lua and is 292k long. It will take some time to digest, but this is exactly the sort of thing you are going to have
to do if your customer is a CNC dumbie or refuses to use CAD/CAM to generate his own code.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Using macros in mach4
« Reply #6 on: July 29, 2019, 08:40:10 AM »
Have you looked into writing a G Code Macro Program?  If it is just positional for punching you may be able to do what you suggested already, make a custom screen that the Macro Program can read using #VARS.
Chad Byrd