Hello Guest it is November 18, 2019, 01:38:10 PM

Author Topic: Manual button for auto zero  (Read 9603 times)

0 Members and 1 Guest are viewing this topic.

Offline Greolt

*
  •  956 956
    • View Profile
Re: Manual button for auto zero
« Reply #20 on: April 17, 2011, 06:50:56 PM »
No I don't Rick.  Have not had anyone else report that.  Does it happen for both Z and A auto tool zero buttons?

Perhaps if it is the second section of the brain that you added, it may be that the timer module is set differently.  Not set as one shot maybe.

It might be worth waiting on Ian to show how this can all be done in a trigger macro.  It would be more elegant.

Greg
« Last Edit: April 17, 2011, 06:53:01 PM by Greolt »

Offline Greolt

*
  •  956 956
    • View Profile
Re: Manual button for auto zero
« Reply #21 on: April 17, 2011, 07:16:17 PM »
Rick

Here is the brain as described earlier.  Using OEMtrigger # 6 and OEMLED 1141

Try this and see if the result is the same.

Greg

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Manual button for auto zero
« Reply #22 on: April 18, 2011, 06:43:12 AM »
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)

Code: [Select]
'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

Offline Greolt

*
  •  956 956
    • View Profile
Re: Manual button for auto zero
« Reply #23 on: April 18, 2011, 08:34:12 AM »
Thanks Ian.  I get the general idea.  Gives me something to work on.

You can't call a macro from a macro....can you?

Greg

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Manual button for auto zero
« Reply #24 on: April 18, 2011, 09:56:11 AM »
You can't call a macro from a macro....can you?

Well.... you can, but there be dragons. Best avoided.

Ian