Hello Guest it is April 20, 2024, 08:22:27 AM

Author Topic: Signal before spindle turns on.  (Read 2026 times)

0 Members and 1 Guest are viewing this topic.

Signal before spindle turns on.
« on: April 03, 2017, 12:52:15 PM »
We have had 2 instances of the spindle coming on while the orient was still engaged.  Our tool change macro doesn't finish until it gets the Orient Release signal,  I'm using the SignalWait command, so I don't know why it continues the macro with the Orient still in engaged.  That is my issue, any ideas why it finishes the macro? 
Now, to prevent this from happening again, I was wondering if there was a way to inhibit the spindle unless the orient release signal was active.  I looked in the Screen Load script and found the SpinCW and SpinCCW functions, I was going to put an "if" statement in there looking for the Orient Release Signal.  Is this where I need to put such code, or is there something else that needs to be done?
-Chad
Chad Byrd

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Signal before spindle turns on.
« Reply #1 on: April 03, 2017, 02:00:05 PM »
Have you tried increasing the timeout value

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Signal before spindle turns on.
« Reply #2 on: April 03, 2017, 02:21:43 PM »
DTG,
What timeout are you referring to?  The plugin?
Chad Byrd

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Signal before spindle turns on.
« Reply #3 on: April 03, 2017, 03:25:32 PM »
The signalwait command has a timeout setting mc.mcSignalWait(number mInst, number sigId, number waitMode, number timeoutSecs)

I think the way I would go is to lengthen the timeout and then put the rest of the macro in an if statement, if sig ==1 then continue...................

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Signal before spindle turns on.
« Reply #4 on: April 03, 2017, 03:34:44 PM »
I have that waiting infinitely.  The tool change is being run by a PLC.  I send an output to the PLC and the last move by the PLC is releasing the orient.  The m6 macro waits until the Orient release before setting the tool numbers and pocket information and finally ending the macro.   
Chad Byrd
Re: Signal before spindle turns on.
« Reply #5 on: April 05, 2017, 12:56:47 PM »
Okay,
I've got something that works great!
I put this code in the PLC Script.  All it does is check for the Orient Signal, if its true it turns off the spindle, CW and CCW.  And for the operator, it has a message saying the spindle is disabled.

--Inhibit spindle if Orient signal is true.
local hSig = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT17) --Orient Signal
local OrientInhibit = mc.mcSignalGetState (hSig)
if (OrientInhibit == 1) then
     local SpinCW = mc.mcSignalGetHandle (inst, mc.OSIG_SPINDLEFWD)
     local SpinCCW = mc.mcSignalGetHandle (inst, mc.OSIG_SPINDLEREV)
     mc.mcSignalSetState (SpinCW,0)
     mc.mcSignalSetState (SpinCCW,0)
     mc.mcCntlSetLastError (inst, "Spindle Disabled")
end
Chad Byrd