4
« on: December 10, 2015, 07:42:40 AM »
Can someone help me how to rotate tool cw / ccw with BCD encoder 1-4 tools .outpt 1 - cw , output2 - ccw, output3 -clok
The engine that runs the three-phase tools with 2 relays
'M6Start.m1s
OldTool = GetOEMDRO (1200)
Tool = GetSelectedTool()
MaxToolNum = 4
If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If
While Tool > MaxToolNum
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Call StartTool
While NewTool <> Tool
Call CheckPins
While IsMoving()
Wend
Wend
Call StopTool
Call SetUserDRO (1200, NewTool)
SetCurrentTool(NewTool)
Sub StartTool
If NevTool< Tool Then
ActivateSignal(Output2)
Exit Sub
End If
While IsMoving()
Wend
If NevTool>Tool Then
ActivateSignal(Output4)
Exit Sub
End If
ActivateSignal(Output3)
While IsMoving()
Wend
End Sub
Sub CheckPins
If IsActive(Input1) Then
NewTool = 1
End If
If IsActive(Input2) Then
NewTool = 2
End If
If IsActive(Input3) Then
NewTool = 3
End If
If IsActive(Input4) Then
NewTool = 4
End If
End Sub
Sub Stoptool
DeActivateSignal(Output2)
While IsMoving()
Wend
ActivateSignal(Output3)
Code "G4 P1.0"
While IsMoving()
Wend
DeActivateSignal(Output3)
DeActivateSignal(Output4)
While IsMoving()
Wend
End Sub
This example works in one direction, what is the problem
thanks