Hello Guest it is March 28, 2024, 02:35:24 PM

Author Topic: Spindle Interlocking  (Read 8315 times)

0 Members and 1 Guest are viewing this topic.

Spindle Interlocking
« on: January 19, 2006, 08:03:15 AM »
Hello members and guest, first post here!

Has anyone else implemented spindle interlocking. I recently retrofitted a Bridgeport BOSS 5 where the M3 is actually a spindle request or enable. There is a input back to the controller that indicates when the spindle is running. I added this logic to the m3.m1s file.

DoSpinCW()
SystemWaitFor (Input2)
Code "G4 P2"

This holds the program until the operater starts the spindle. I had to put the spin up delay in the logic because it needs to happen after the spindle has been started. This should also work with the @ speed contact on most spindle drives, omit the delay. I started working on logic in the macropump to monitor the spindle and reached my coding limit. This is what I have so far and I know there must be a better way to code this (my mind is clouded with another controller's logic.).

If GetOEMLED (11) Then If Not IsActive (Input2) Then DoOEMButton (1003)
Message "PROGRAM STOPPED Spindle fault"

I would like to set a variable when leaving the m3.m1s file, example SpinRequest, then have the macro pump check this variable. If the variable has not been set then exit the logic. If the variable has been set then proceed to check input2. If input2 is on then exit the logic. If input2 is off then stop the program and issue a spindle fault message. I need Help learning the language. The logic above was the only thing I could come up with that would compile without a syntax error.

Darek Ashburn   

Re: Spindle Interlocking
« Reply #1 on: January 19, 2006, 10:39:24 AM »
You can do this by setting LED's on the screen.

So in the m3 macro put in CallsetuserLED(1010,1) and it will turn on dro 1010

Then you can test to see if that is set with GetUserLED(1010)

I think you have all the other stuff that you need.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Spindle Interlocking
« Reply #2 on: January 19, 2006, 03:59:34 PM »
Thanks Brian,

DoSpinCW()
SystemWaitFor (Input2)
Code "G4 P2"
Call SetUserLED(1010,1)

I ran into a snag. It appears the SystemWaitFor command does not stop the processing of the Call SetUserLED command.

Darek Ashburn

Art

*
Re: Spindle Interlocking
« Reply #3 on: January 19, 2006, 06:25:56 PM »
Hi :

 I belive you need a  While  IsMoving() Wend
loop for that to work. I thingk the IsMoving macro will report a true while waiting for an event..

Art
Re: Spindle Interlocking
« Reply #4 on: January 19, 2006, 07:37:44 PM »
Thanks Art,

That was the ticket. Another question. How do I tie the message onto the DoOEMButton (1003) statement. 

If GetUserLED (1010) Then If Not IsActive (Input2) Then DoOEMButton (1003)
Message "PROGRAM STOPPED Spindle fault"

Darek
Re: Spindle Interlocking
« Reply #5 on: January 19, 2006, 07:40:48 PM »
If you would like to have a message box you can do this

MsgBox"This is an ERROR!!!"

Put tha in the scripter and you will see a message box :)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Spindle Interlocking
« Reply #6 on: January 20, 2006, 06:45:28 AM »
I like that Brian,

How do I include this after the DoOEMButton(1003). The way I have it on the next line it runs everytime the MACROPUMP runs.

Darek
Re: Spindle Interlocking
« Reply #7 on: January 20, 2006, 08:01:41 AM »
Try this  ;D
If GetUserLED (1010) Then
   If Not IsActive (Input2) Then
      DoOEMButton (1003)
      MsgBox "PROGRAM STOPPED Spindle fault"
   End If
End If

Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Spindle Interlocking
« Reply #8 on: January 20, 2006, 07:52:38 PM »
That makes it do exactly what I wanted! I think I'm getting it. Oh yea I added Call SetUserLED(1010,0) to the m5.m1s

Excellent support!
Darek

Offline mhdale

*
  •  130 130
  • Knowledge is the Treasure.
    • View Profile
    • Black Dragon Technologies
Re: Spindle Interlocking
« Reply #9 on: January 23, 2006, 09:38:07 PM »
Greetings, I am very new in the use and implementation of Mach 3. I just received Some hardware bundled with the Mach 3 as a long overdue upgrade to my CNC system. I am posting this question here as it seems most relevant to this conversation. I am trying to implement some sort of spindle lock feature as described here. I am a total newbie in coding the Mach 3 stuff so please bear with me if I blunder on terminology. I want my Mach 3 System to "WAIT" for the Spindle to send back a Spindle Ready Signal before running the rest of the program. As well I would like it to monitor that Spindle Ready Condition and if it Changes to halt the execution of the code until such time as it detects a ready signal again. Is this possible? ::)

Thanks
Mike