Machsupport Forum

Mach Discussion => Brains Development => Topic started by: zmnck on December 28, 2017, 03:15:17 AM

Title: Stop any movement of axis if Input is not active
Post by: zmnck on December 28, 2017, 03:15:17 AM
Hello,

How to stop any movement of axis (when JOGĂ­ng or when G-Code is active) if Input is not active. ?

Cheers!

Title: Re: Stop any movement of axis if Input is not active
Post by: ger21 on December 28, 2017, 07:29:02 AM
Assign the input as a limit switch?
Title: Re: Stop any movement of axis if Input is not active
Post by: zmnck on December 28, 2017, 02:11:09 PM
Hello,

Thanks for you reply.

But I think no, because I'm using Mach3 for this machine, you can watch on YouTube:

https://www.youtube.com/watch?v=UZgq2EKJ3qE

I need to stop the movement if Nail Gun is in the below, and when he back on the top the movement can be done.

So I think I should write macro to wait (sleep) until Input * is active...

But I'm wondering why there is no such thing to stop axis while G-Code is running to stop movement if button is pressed and when is realease G-Code can be resumed.....

Also I have tried to write a Brain (Input 1 -> No operation -> OEM @250 Inhibit axis movement X) but it's not working while G-Code is running.

Thanks for your answer, if you have any suggestion I will kindly accept it.

Best wishes,
Thanks!
Title: Re: Stop any movement of axis if Input is not active
Post by: ger21 on December 28, 2017, 03:48:53 PM
Have the button trigger the Feedhold.
Title: Re: Stop any movement of axis if Input is not active
Post by: TPS on December 29, 2017, 02:43:46 AM
Hi,

i think you have to "split" this into two parts.

part 1 witch is in the macro what enables the nailer.
here you have to wait for the Input after the nailing something like this:

Code: [Select]

'wait for Input1
While Input1 = false
Sleep(200)
Wend


part 2 will be in macropump, and only stop X-Axis if x-Axis is running and Input1 is off

Code: [Select]

IF ((GetoemDRO(806) > 0) and (Input1 = False)) Then
  DoOEMButton(1003)
End If


Thomas   
Title: Re: Stop any movement of axis if Input is not active
Post by: zmnck on December 29, 2017, 06:43:39 AM
Hello,

Very good idea Thomas, thanks.

Can you please explain me what are you calling "macropump" ?

IF ((GetoemDRO(806) > 0) and (Input1 = False)) Then
  DoOEMButton(1003)
End If

Thanks.
Title: Re: Stop any movement of axis if Input is not active
Post by: TPS on December 29, 2017, 06:50:12 AM
OK, no problem.

in your macrofolder (normaly  C:\Mach3\macros\yourprofilename)
should be a macro called macropump.m1s .
if not create one with Texteditor and put These code in:

Code: [Select]

Sub Main()

  IF ((GetoemDRO(806) > 0) and (Input1 = False)) Then
    DoOEMButton(1003)
  End If

End Sub


make sure that in Config -> General Config -> Run Macro Pump is enabled.
Restart Mach3

test.

Thomas