Hello Guest it is July 06, 2020, 02:44:18 AM

Author Topic: mcodes, additional inputs  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

mcodes, additional inputs
« on: February 20, 2009, 04:08:36 PM »
I have text searched every document I can find and watched all the videos that seemed appropriate. I can't find anywhere that tells how to map output signals to M-codes.   Mcode isn't even mentioned in the "...Software Installation and Configuration" manual.
Isn't there some tutorial that tells step by step everything necessary to map all normal functions to the Mach software?

I'm using a DSPMC with Mach.  The DSPMC is capable of up to 32 inputs.  I can find only 4 generic Mach inputs, besides the normal ES, limit switches, etc., that can be mapped to the DSPMC.  How can I get additional inputs?

I found bits and pieces of installation info spread over  many documents and videos, but nothing comprehensive.  

ANY help would be appreciated.  I'm falling farther behind each day.

Jack Adams
Re: mcodes, additional inputs
« Reply #1 on: February 20, 2009, 04:30:40 PM »
It's not real clear what you want, but I think your first question is asking how to add an M-code that will set an output signal, right?

If so, go to Operator->VB Script Editor, and create a new macro file in the appropriate subdirectory of the Mach3\macros directory.  For example, if you're using Mach3Mill, and want to define M125, create the file M125.m1s in Mach3\macros\Mach3Mill.  This file should contain something like:

    ActivateSignal(OutPut4)

    or

    DeActivateSignal(OutPut4)

    to set or clear the pin corresponding to Output4 in your Config->Ports&Pins->Outputs configuration.  Putting "M125" in your G-code will execute this macro.  I believe you should use a number between 100 and 255, as M codes under 100 are reserved for Mach3.

    I don't believe there's any reason you can't use the "OEM Trigger" inputs as additional inputs, so you've got at least 20 outputs and 20 inputs to work with.

Regards,
Ray L.

Regards,
Ray L.
Re: mcodes, additional inputs
« Reply #2 on: February 20, 2009, 05:10:38 PM »
Ray-

Thanks.  That helped a lot.  Its nice to know I can create my own Mcodes (I don't know why I would need one yet), but basically I just wanted to map M3, M4, M7, etc, just the ones for basic machine functionality.  After reading your reply I went back to the manual and searched for 'macro'.   There are many mentions of needing a macro for various functions and not one bit of info about how to create or use them.  I also checked for a video.  There's nothing obvious there, either.  Where can I find that information?  I may have missed something right in front of me, but I've spent > 8 hrs searching documents and videos.

JA

Offline Hood

*
  •  25,846 25,846
  • Carnoustie, Scotland
    • View Profile
Re: mcodes, additional inputs
« Reply #3 on: February 20, 2009, 05:20:53 PM »
There is some info on the wiki and also some info in the Customising Mach2 manual.
 M3, M4, M5 etc should not need a user made macro, unless that is your spindle works in a different way than normal, my lathe was like that and I made custom macros for it.
Hood
Re: mcodes, additional inputs
« Reply #4 on: February 20, 2009, 05:26:01 PM »
Ray-

Thanks.  That helped a lot.  Its nice to know I can create my own Mcodes (I don't know why I would need one yet), but basically I just wanted to map M3, M4, M7, etc, just the ones for basic machine functionality.  After reading your reply I went back to the manual and searched for 'macro'.   There are many mentions of needing a macro for various functions and not one bit of info about how to create or use them.  I also checked for a video.  There's nothing obvious there, either.  Where can I find that information?  I may have missed something right in front of me, but I've spent > 8 hrs searching documents and videos.

JA

M3 and M4 are setup through Config->Ports&Pins->SpindleSetup.  You can configure two relays, one to be activated on M3, the other on M4, and both will be de-activated on M5.  You can map these to be controlled by any output pin.  If you need spindle speed control, that is also configured in the same place.

Regards,
Ray L.
Regards,
Ray L.