Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ggagnon on September 19, 2017, 09:41:46 PM

Title: Mach3: How to Activate/deactivate a button in a macro
Post by: ggagnon on September 19, 2017, 09:41:46 PM
Mach3:
Is there a way or a function to enable/block a button programmatically in a macro so it is not clikable?
Thanks,
Gaston
Title: Re: Mach3: How to grey out a button in a macro
Post by: ggagnon on September 22, 2017, 04:01:55 PM
I will try to make my question a little clearer.
 
Mach3:
Is there a way to grey out / un grey out a button within a macro depending whether certain conditions a met or not?
Thanks,
Gaston
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: ger21 on September 22, 2017, 09:11:07 PM
No, I don't believe so.
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: joeaverage on September 22, 2017, 09:23:00 PM
Hi,
I think you can do that with LUA in Mach4...I'm not familiar enuf with VB in Mach3 to comment, ger21 thinks not and he really knows hi stuff.

Craig
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: ggagnon on September 22, 2017, 11:04:03 PM
I use MachScreen for screen editor and I did not find a greyed as initial state for new button so I kind of expected that it would not be possible.
Thanks Gerry and Craig for taking the time to answer.
Gaston
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: Klaus1311 on September 23, 2017, 06:26:42 AM
Hi

I've added a sample (ToggleButtonColor) on my website, which changes the color of a button, depending on the toggle state.

Klaus
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: ggagnon on September 23, 2017, 03:24:09 PM
Thanks Klaus,
That will solve my problem,
Two questions:
 How to assure the led is off when Mach3 starts?
 Is there a way to prevent Machscreen's editor from inserting tabs automatically?

Gaston
Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: Klaus1311 on September 23, 2017, 05:39:05 PM
Hi Gaston

- you could create a macro e. g. m800.m1s containing:

setuserled(1200,0)

and put that macro to your init string in general config.

- I'm not sure, this helps, but tab value can be set in Options -> Settings -> Editor Settings -> Tabulator.

Klaus


Title: Re: Mach3: How to Activate/deactivate a button in a macro
Post by: ggagnon on September 24, 2017, 01:49:14 AM
Bingo, that does it.
I had forgotten that a macro could be executed when mach3 starts.
Thanks,
Gaston