Ian
The advantage of using a brain is the timer safety. If the switch/button is held for less than the specified time (2 sec) then nothing happens.
Can you give us an example of how to do this in the trigger macro. It would be very handy to know how this is done.
Would it be an if/then with a pause and recheck input?
Greg
Hi Greg - see my suggested example in my previous post. FWIW using the macro method I don't think there's a need for checking IsMoving and Enable like in your Brian because Mach ignores macro generated movement whilst already in motion and doesn't execute macros whilst in reset. That would just leave your spindle check which could be done the macro equivalent way as the Brian i.e. by checking LED 116.
So my example macro 666.m1s above might look something like this: (change trigger #s to suit)
'wait before doing checks so that a trigger must still be active after 2 secs for the following to succeed
sleep 2000
'if T1 is still active i.e. button is still pressed after 2 secs and spindle is off
If isActive(OEMTRIG1) and not getOEMLED(116) Then
'paste your Z axis tool setting code here
End If
'if T2 is still active i.e. button is still pressed after 2 secs and spindle is off
If isActive(OEMTRIG2) and not getOEMLED(116) Then
'paste your A axis tool setting code here
End If
Let me know how you get on.
Cheers
Ian