Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: coyotegd on September 10, 2007, 04:26:44 PM

Title: How to use Mach3 outputs?
Post by: coyotegd on September 10, 2007, 04:26:44 PM
I know how to assign outputs to the spindle, flood, etc.  These have specific menu entries in "Config", "Ports and Pins", and tabs, "Output Signals" and "Spindle Setup".  However, lets say I have enabled a MACH3 output to turn on an auxiliary 120VAC, and I have assigned it a pin number.

How would I use G-code to tell MACH3 to turn on the output for "Auxiliary 120VAC"?

How can I turn on the MACH3 output for "Auxiliary 120VAC" while working in the MACH3 software, which would be like the "Spindle Toggle" button in "Diagnostics"?
Title: Re: How to use Mach3 outputs?
Post by: comet on September 10, 2007, 04:38:53 PM
hi,
  dont know if its any use but I use the m07 comand (I only use flood coolant)
to operate a Quill lock. obviously you have to manually put that code in if your using a cam package.
 tony
Title: Re: How to use Mach3 outputs?
Post by: coyotegd on September 10, 2007, 04:49:31 PM
I think I understand how you did it.  On the "Sindle Setup" tab, you enter your assigned pin number in the "Mist M7 Output #" entry.  I need to go beyond this. However, if all else fails, I use only flood too.
Title: Re: How to use Mach3 outputs?
Post by: Whacko on September 10, 2007, 05:07:10 PM
You can call macro's that you have created with your own custom numbers and your own VBscript. There is lots of options once you realise how you can implement them.
Do you know VBscript?
I have for instance a macro I named m330 and added this macro call to the initialization string in the config menu.

It reads:
DoButton ( 22 )
DoButton ( 23 )
DoButton ( 24 )
DoOEMButton ( 223 )


I'm tailing you cause your username says coyote! Just joking! :D

Whacko
Title: Re: How to use Mach3 outputs?
Post by: coyotegd on September 10, 2007, 05:31:43 PM
I can program in Visual Basic, so I know I can catch on to VBScript.  When you say "initialization string in the config menu", do you mean the "General Logic Configuration" form, where under "Startup Modals" and "Initialization String", there is a one-line textbox?

So what do you have there?  Is it, "G80 M330"?

I assume I store the "txt" file macro in the "macros"/"Mach3Mill" folder on the hard drive.

Is a button a simple "gif" image or do I make it in Mach3, and how do I have it appear on the "Diagnostics" screen, and assign a macro to it?

Can you include macro file names in the G code?
Title: Re: How to use Mach3 outputs?
Post by: Whacko on September 10, 2007, 05:37:08 PM
Mach3 has a built in editor, and you can step through the code and check the results in realtime. It's under "Operator menu", select "VBScript editor".
That's the one, the textbox. But you can call macro's embedded in your Gcode too. I have modified my m4 m5 m7 m8 macro's too do what I want them to do. It's really nifty and enables you to tailor Mach3 to suit your own needs.

Whacko

Edit: The Macro's has a .m1s extension. Best to create them in the Mach3 environment.
Title: Re: How to use Mach3 outputs?
Post by: Whacko on September 10, 2007, 05:41:03 PM
Have you got the executable Mach3Screen.exe in your Mach3 folder? That's where you add buttons, edit screen layouts etc. Almost a bit like your Winforms in VB

Whacko
Title: Re: How to use Mach3 outputs?
Post by: coyotegd on September 10, 2007, 05:56:56 PM
No I don't have "Mach3Screen.exe" in my Mach3 folder.  I looked in the downloads on the Artsoft website, but I can't find it.

Where do you download the screen editor and other advanced Mach3 software?

NEVER MIND I FOUND THE DOWNLOAD.
Title: Re: How to use Mach3 outputs?
Post by: Hood on September 10, 2007, 06:09:06 PM
Mach3screen is the old screen editer, Screen4 is the new one. You can use either of them but screen4 is best especially if you want skins etc on DRO's and buttons that are more than just the standard.
Hood
Title: Re: How to use Mach3 outputs?
Post by: Ghantos on March 24, 2014, 01:40:09 PM
Hello friends,
I want to know how I can control a relay contact in mach3?

I have a pneumatic valve controlled with 24vdc relay.
What I need to do is to define  a new Mcode (i.e M77) and to refer it to a free output from mach3.
 When M77 in process, the relay is activated until been reset by M78 for example.

Has anybody an idea??
Regards,
Ghantos
Title: Re: How to use Mach3 outputs?
Post by: Hood on March 24, 2014, 03:11:45 PM
First thing to say is technically you should not use under 100 for custom M codes as they are supposed to be reserved for Mach use, so best to use 101 or higher.

To activate an output (example OutPut1) via a macro you would just have the following in your macro

ActivateSignal(OutPut1)

To deactivate it the macro would be

DeActivateSignal(OutPut1)


Hood
Title: Re: How to use Mach3 outputs?
Post by: Ghantos on March 24, 2014, 03:22:02 PM
Thank you hood!!!!!
You are great   :)
Title: Re: How to use Mach3 outputs?
Post by: ajwatt on May 14, 2020, 07:55:41 PM
I spent alot of time trying to find a solution to automatically turning on a dust extractor, water pump or a vacuum board and everything I found was to use the flood button and to add the m8 into the gcode file.
That was all just to painfull adding to every gcode file.
all you need to do is add  ActivateSignal(OutPut1) to m3 macro file and DeActivateSignal(OutPut1) to m5 macro file
eg. M3 macro
DoSpinCW()
ActivateSignal(OutPut1)

M5
DoSpinStop()
DeActivateSignal(OutPut1)

this will turn on and off output 1 with the spindle motor automatically
the only change you need to make is to change the output number to suit your setup eg. ActivateSignal(OutPut2) , DeActivateSignal(OutPut2)

the location of the macro file is C:\Mach3\macros\Mach3Mill


Title: Re: How to use Mach3 outputs?
Post by: Tweakie.CNC on May 15, 2020, 01:08:35 AM
Excellent tip ajwatt.

Tweakie.