Hello Guest it is June 24, 2019, 10:23:23 AM

Author Topic: Mach4 SUB to do sequential S/N engraving  (Read 2732 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

  •  6,873 6,873
    • View Profile
Mach4 SUB to do sequential S/N engraving
« on: June 01, 2014, 03:19:33 PM »
Here is a SUB/Macro program that allows you to do sequential S/N engraving. The serial NUMBER is held in #VAR  #590  it is a 6 digit number 987654 when it gets to 999999 it will roll over to 000001 on the next call.

The website will NOT take the native file so I had to ZIP it . You will have to UNZIP it on your end then place in the SUBROUTINES folder.

You must copy it into the mach4 SUBROUTINES folder. IF you modify it make SURE you follow the correct proceedure for a SUB program File it is o9001 with NO extensions at the end of file. Currently the Gcode editor does NOT give you that option.  Notepad WILL do it on an original file. IF it ever gets changed I have to go out to a DOS promt and do a Rename from o9001.txt to o9001  

 Use {Rename o9001.txt o9001 from the DOS prompt}

You can reset the Serial number anytime by MDI  #590 = 123456.  IF you add to many digits for example  1111111 then the macro will NOT run but alert you to reset the Serial Number. The macro does NOT see any decimal values in the #var.

The Size is currently SET. Furture versions will allow you to scale the Charactors to suite your application.

To call it you can do so several ways. Simply move to the start point of the Engraving and call it by

M98 P9001


M65 P9001

The code uses the Centerline of the charectors as the start/end point  of each charactor

YOU CAN add the serial number DRO and script support to your screen to make it even easier to use. But this version will work for everyone.

IF you care to modify it for IMPROVMENTS please do and POST it back in the Mach4 ToolBox for everybody to use/enjoy.

Thanks, (;-) TP
« Last Edit: June 01, 2014, 03:32:53 PM by BR549 »
Re: Mach4 SUB to do sequential S/N engraving
« Reply #1 on: January 28, 2017, 11:59:07 AM »
I know this is an old post, but this is helping me with a project for university... I'm working with the mach4 industrial and building a post processor for SolidCAM fully compatible with mach4.
The quesiton here is:
If I put a file like O9810.txt where the file, In example, has the subroutine of a Renishaw probe operation, when I call the macro in my program like

G65 P9810 X34.54 Y54.98
G65 P9810 Z1

Then mach4 will understand that my call is for the subroutine I save in the Subroutines folder? Or how it works?
In other case, if I make a macro with Lua Script like the example provided in the manual called M1005, then when I program the post processor to execute M1005 with the necesary parameter Mach4 will understand that it have to make the macro Gcode?

Any help will be useful, thanks in advance.

Sorry for my english.