Hello Guest it is March 28, 2024, 07:44:50 AM

Author Topic: MCODE  (Read 5457 times)

0 Members and 1 Guest are viewing this topic.

MCODE
« on: October 09, 2008, 04:43:27 PM »
I want to generate new Mcode's for setting the outputs in Mach3.
Can anybody shed some light this subject please?

Alex.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: MCODE
« Reply #1 on: October 09, 2008, 04:51:48 PM »
You just need to open a text file, write your VB in it then save it as m***.m1s, *** being the number that you want the M code to be. M codes under 100 are supposed to be used only for Mach internals so user M codes should really start from 100 up. The location you save the Macro to will be the macro folder of the profile you are using, ie if using the standard Mach3Mill profile then it will be C:\Mach3\Macros\Mach3Mill

To activate an output you just need to put the following in your macro
ActivateSignal (OutPut*)

The * is the output number you want to activate.
 To disable an output you will need to make a macro with
DeActivateSignal (OutPut*)

Hood

Re: MCODE
« Reply #2 on: October 09, 2008, 05:07:52 PM »
Thanks Hood.

I dont understand macros enough to make sense of that completly. Are there any examples of complete mcode macros that have been written? 

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: MCODE
« Reply #3 on: October 09, 2008, 05:16:09 PM »
That is all you need in a macro to enable an output from an M code, ie
Open a text file, type ActivateSignal (OutPut4)  in it then use the Save As option and name it M100.m1s and save to your profiles macro folder as detailed in the previous post. From then on any time your code has M100 in it OutPut 4 will turn on.
If you did the same as above but put DeactivateSignal (OutPut4) in the text file and saved it as M101.m1s then everytime you called M101 from your code Output 4 would switch off.

If you are trying to do something more complex then you will need to say so we know what you are trying to do.
Hood
Re: MCODE
« Reply #4 on: October 10, 2008, 10:52:52 AM »
Thanks again Hood. I did exactly what you said and it worked perfectly. Thanks for helping me with my first ever macro!! 

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: MCODE
« Reply #5 on: October 10, 2008, 11:10:11 AM »
:)