Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: omegasea21 on April 13, 2010, 12:37:55 AM

Title: Help with activating m3, m4, m5 when condition is met
Post by: omegasea21 on April 13, 2010, 12:37:55 AM
Hello, what is the easiest way to do the following. I can't seem to get it to work.

Activate spindle relay Clockwiise - M3
Stop sprindle (M5) when freedrate DRO > 19 (feedrate DRO  is 821)
If input 1 (port 0, pin 6) is active then Activate spindle CCW - M4
Stop sprindle (M5) when freedrate DRO < 2

Any help would greatly be appreciated!
Title: Re: Help with activating m3, m4, m5 when condition is met
Post by: Hood on April 13, 2010, 02:31:41 AM
Easiest way is to write a macropump to do what you want. I am not the best at VB but something like this should work

Spindle = GetOemDRO(821)

If Spindle >19 Then
Code("M5")
If IsActive(InPut1) Then
Code("M4")
If Spindle <2 Then
Code("M5")
End If
End If
End If
Title: Re: Help with activating m3, m4, m5 when condition is met
Post by: omegasea21 on April 13, 2010, 10:29:09 PM
Thank you so much!!!