1041
General Mach Discussion / Re: REFF ALL HOME script
« on: February 04, 2020, 01:30:10 AM »
can you see the Mxhome LED's Show up on diagnostic page?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
If GetOemLED(821) Then 'Bar end signal
Code "G0 G54 Z110"
ResetOutBit(90,11) 'Collet close reset
SetOutBit(90,9) 'Collet Open
SetOutBit(90,6) 'Collet Open
SetUserLed(1001,1) 'Set Collet open LED ON
While Not(GetInBit(91,1)) 'Wait for Start signal from Bar fedder
Sleep(100)
Wend
Code "G0 G54 Z-35"
Sleep 1000
If GetInBit(91,1) = 0 Then 'Wait for Start signal from Bar fedder
Sleep(100)
End If
ResetOutBit(90,9) 'Reset Collet Open
ResetOutBit(90,6) 'Reset Collet Open
SetOutBit(90,11) 'Collet Close
Sleep 100
SetUserLed(1001,0) 'Set Collet open LED OFF
Sleep 2000
Else
ResetOutBit(90,11) 'Collet close reset
sleep 100
SetOutBit(90,9) 'Collet Open
SetOutBit(90,6) 'Collet Open
SetUserLed(1001,1) 'Set Collet open LED ON
While Not(GetInBit(91,1)) 'Wait for Start signal from Bar fedder
Sleep(100)
Wend
ResetOutBit(90,9) 'Reset Collet Open
ResetOutBit(90,6) 'Reset Collet Open
SetOutBit(90,11) 'Collet Close
sleep 100
SetUserLed(1001,0) 'Set Collet open LED OFF
Sleep 2000
End If
... But the problem is that, when it comes to If GetInBit(90,17) = False Then, it does not wait here ...
If GetInBit(90,16) Then 'Bar end signal
Code "G0 G54 Z110" 'Clear to make space for Bar fedder to push remnant out
ResetOutBit(90,11) 'Collet close reset
SetOutBit(90,9) 'Collet Open
SetOutBit(90,6) 'Collet Open
SetUserLed(1001,1) 'Set Collet open LED ON
If GetInBit(90,17) = False Then 'Wait for Start signal from Bar fedder
Sleep(50)
End If
Code "G0 G54 Z-35" 'Position stopper at top cut position
Sleep(1000)
If GetInBit(90,17) = False Then 'Wait for Start signal from Bar fedder
Sleep(50)
End If
ResetOutBit(90,9) 'Reset Collet Open
ResetOutBit(90,6) 'Reset Collet Open
SetOutBit(90,11) 'Collet Close
Sleep(100)
SetUserLed(1001,0) 'Set Collet open LED OFF
Sleep(2000)
Else
ResetOutBit(90,11) 'Collet close reset
Sleep(100)
SetOutBit(90,9) 'Collet Open
SetOutBit(90,6) 'Collet Open
SetUserLed(1001,1) 'Set Collet open LED ON
If GetInBit(90,17) = False Then 'Wait for Start signal from Bar fedder
Sleep(50)
End If
ResetOutBit(90,9) 'Reset Collet Open
ResetOutBit(90,6) 'Reset Collet Open
SetOutBit(90,11) 'Collet Close
Sleep(100)
SetUserLed(1001,0) 'Set Collet open LED OFF
Sleep(2000)
End If
If GetOemLED(821) Then
Code "G0 G54 Z110"
ResetOutBit(90,11)
SetOutBit(90,9)
SetOutBit(90,6)
SetUserLed(1001,1
Else
ResetOutBit(90,11)
SetOutBit(90,9)
SetOutBit(90,6)
SetUserLed(1001,1)
If GetInBit(adr, bit) = False Then
Sleep(50)
End If
ResetOutBit(90,9)
ResetOutBit(90,6)
Sleep 100
SetOutBit(90,11)
SetUserLed(1001,0)
End If
you Need to replace "adr" and "bit" by your real values.
If GetInBit(adr, bit) = False Then
Sleep(50)
End If