Hello Guest it is May 23, 2019, 11:43:24 PM

Author Topic: Macros  (Read 1026 times)

0 Members and 1 Guest are viewing this topic.

Macros
« on: August 04, 2016, 05:00:43 PM »
Mach3 setup and I want a lamp to light when the program has finished. I added a macro to the macro folder called M30 with the code ActivateSignal (OUTPUT5). If I run the code in the VB editor window it works ok and reset cancels the output. However M30 in the code did not run the macro. In case M30 was not allowed I tried M100 and also M3 but they would not run my code. I have tried with 2 separate mach3 machines with the same result. What am I doing wrong?

Offline Hood

*
  •  25,815 25,815
  • Carnoustie, Scotland
    • View Profile
Re: Macros
« Reply #1 on: August 04, 2016, 06:08:27 PM »
First thing is the macro needs to be in the folder named after the profile you are using which is in the macro folder, so for example if you use the default Mach3Mill profile then it would be placed in the Mach3Mill folder which is in the Macro folder.

Ok so the macro, you really want to name 101.m1s or above, then when you call that m101 (or whatever)  from your  code or call from MDI  it should run. If it doesn't then most likely  the macro is not in the correct folder or possibly there is a syntax error in it, with the latter you should see an error message in the ticker window.

Hood
Re: Macros
« Reply #2 on: August 05, 2016, 06:09:53 AM »
Thanks Hood
Everything was in the right place with no errors but for some reason it did not like me using M100 or M30, as soon as I used M101 it worked ok.
I was hoping to use M30 as most programs already finish with this but I guess it is no bother to add M101.

Offline Hood

*
  •  25,815 25,815
  • Carnoustie, Scotland
    • View Profile
Re: Macros
« Reply #3 on: August 05, 2016, 06:16:40 AM »
M30 is an internal Mach code and M100 does not work, has to be M101 or above.
Although unused codes below 100 can be used it is not recommended.

Hood