Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: Trebleplink on January 03, 2026, 12:19:48 PM

Title: I'm missing something fundamental with Macros.
Post by: Trebleplink on January 03, 2026, 12:19:48 PM
I assembled my Chinese milling machine which is about the size of a Bridgeport in 2007.  It uses parallel ports and Mach3 runs on XP.  Recently I upgraded to nema 34 hybrid stepper motors and have been trying to improve things a bit.

I have some programming experience with Visual Basic but cannot get a macro to work; I'm missing something fundamental.

I wrote:   DoOEMButton(110)

in a M120.m1s txt file in the macros folder. The intent is to start the spindle.  When I enter M120 in the MDI nothing happens.  So I put it in a txt file and try to run it as I would Gcode.   Nothing happens.
Title: Re: I'm missing something fundamental with Macros.
Post by: TPS on January 04, 2026, 05:54:59 AM
for test that the macro is called you can enter a:
Code: [Select]
msgbox "i was here"

before your DoOEMButton

make sure you have a CRLF after your DoOEMButton(110)
so the M120.m1s has a empty line at he end.
Title: Re: I'm missing something fundamental with Macros.
Post by: Trebleplink on January 05, 2026, 11:11:52 AM
Thanks.   My fiber Internet has been down since Saturday.

I fixed the problem:  My Mach3 Macros folder had several other folders in it due to mach updating.  If I placed the .M1s file in the newest one it works.