Hello Guest it is April 19, 2024, 10:46:42 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - stirling

51
General Mach Discussion / Re: Run a macro from a button press??
« on: September 26, 2016, 05:30:48 AM »
OK - I might have mis-understood what you're wanting to do.

I read it as you wanted to run a macro BOTH from an external (real) button AND from a screen button.

I'm now thinking the use of a screen button was just your way of trying it and that all you really want is to run a macro from an external button. Is that correct?

If so then forget about the screen button completely.

Just use the macropump and if you don't want to put all the code IN the macropump then call it using runScript.

A word about trigger macros.

In this post http://www.machsupport.com/forum/index.php/topic,15120.msg101160.html#msg101160 I describe a way to fire multiple macros using OEMTriggers.

However, after I wrote that I discovered an annoying bug so I would use the macropump now instead.

The bug, if you're interested, is that whilst an OEM code trigger fires immediately, the trigger macro doesn't fire if there's anything in the gcode buffer. i.e. it will fire at some time later when the buffer becomes empty. If that's ok for your usage then fine but often you want the macro to run immediately regardless and that won't work. Like I said earlier I asked Brian to fix this ages ago when Mach3 was still supported but he chose not to for whatever reason.

52
General Mach Discussion / Re: Run a macro from a button press??
« on: September 25, 2016, 01:23:30 PM »
Not in my version of Screen 4 - there are 4 options (which is correct because ALL editors should provide the 4 capabilities of the screen "driver" itself).

1) System Function
2) OEM Code Function
3) GCode Function
4) VB Script function edited in Mach3

If you set button option 4 and do what I said in #8 you're good to go.

53
General Mach Discussion / Re: Run a macro from a button press??
« on: September 25, 2016, 12:03:13 PM »
The button has no code in it luckily - it just has the "run macro...." attribute set - i guess thats the same as an internal "runscript..."

I have no idea what that means but I doubt it's what you think it means.

54
General Mach Discussion / Re: Run a macro from a button press??
« on: September 25, 2016, 11:44:27 AM »
yep - 'fraid so.

AFAIK there's no "elegant" way to do what you're after.

But you have clues earlier. i.e. the macropump and runscript. (note: runscript isn't present in earlier versions of Mach3 - I can't use it for example because I use 3.42.20)

Here's one way:

put your macro code in a file.

Monitor your input in the macropump and use runscript to run your macro (as opposed to putting the code itself in the macropump). If you do this be aware of the difference between an input BEING active and an input GOING active. Otherwise you'll end up in a world of pain.

Then also put a runscript call in your button.

Then at least you have just one copy of code run from two places as opposed to two copies - one in the pump and the other in the button.

FWIW - you *should* have been able to use a trigger macro but they're flawed. I raised it with Brian a thousand years ago but he couldn't see the problem so wouldn't fix it.


55
General Mach Discussion / Re: Run a macro from a button press??
« on: September 25, 2016, 11:29:51 AM »
Hi Dave

You're confusing OEM codes with hot key codes.

56
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 16, 2016, 07:25:48 AM »
 ;)

57
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 16, 2016, 06:43:24 AM »
Nooooooooooooooooooooooooooooo...  ;D

You've gone back to where you started.

See reply #7

58
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 16, 2016, 05:54:54 AM »
presuming there is no sneaky macro stuff running elsewhere calling an ActivateSignal(OUTPUTxx) :)

well indeed - but if you have a system that does that I'd suggest a career in piano playing is not going to end well.  ;)

59
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 16, 2016, 05:22:44 AM »
Nope.

You start Mach and do an M4 - spindle CCW
You do a M5 - spindle stopped.
You hit the button - both leds are off so it goes to the else clause to turn it on.
But which way?
Well - 1601 has never been touched yet so it's zero
So your spindle starts CW. - i.e. NOT what it was last doing.

60
General Mach Discussion / Re: Spindle button and M3 and M4
« on: September 16, 2016, 04:06:54 AM »
Just a thought but...

you start Mach and command M4, then M5. You then hit the spindle button - which way does the spindle turn?

I wonder if your original mods to M3/4 would give a more consistent feel.

Up to zmajmr I guess.

now if only there was a list of variables or a way of finding free ones ???

Not sure there's a definitive list but do some searches - there's bits and pieces scattered about - think of it as Mach3 Pokemon go  ;D.

also interesting info on destroying variables (BASIC) :)

The variables you create in a macro are all local, so like any other similar language, they are created and destroyed with each invocation.