Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: ahmedrehan on February 22, 2009, 02:24:22 AM
-
Hi,
I am facing a strange problem my lathe turret has 10 tool i made a binray 4 bit to select tool when i use only 3 inputs it works fine as soon as i give 4th input to parallel port it halts the system. I have cheked this on built in parallel port and pci parallel port card it gives same problem. Any sujestion or any one facing same problem.
Regards
Ahmed
-
What is in your macro?
Hood
-
What is in your macro?
Hood
I modified the 3 input tool changer on forum as under:
Sub Main()
NewTool = GetSelectedTool()
OldTool = GetCurrentTool()
MaxToolNum = 10 'Max number of tools for the changer
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
If NewTool = OldTool Or NewTool = 0 Then
Exit Sub
End If
If OldTool <> NewTool Then
While Slot <> NewTool
ActivateSignal(OUTPUT3) 'start rotating forward
If Not IsActive(INPUT4) And Not IsActive(INPUT3) And Not IsActive(INPUT2) And IsActive (INPUT1) Then
Slot = 1
End If
If Not IsActive(INPUT4) And Not IsActive(INPUT3) And IsActive(INPUT2) And Not IsActive (INPUT1) Then
Slot = 2
End If
If Not IsActive(INPUT4) And Not IsActive(INPUT3) And IsActive(INPUT2) And IsActive (INPUT1) Then
Slot = 3
End If
If Not IsActive(INPUT4) And IsActive(INPUT3) And Not IsActive(INPUT2) And Not IsActive(INPUT1) Then
Slot = 4
End If
If Not IsActive(INPUT4) And IsActive(INPUT3) And Not IsActive(INPUT2) And IsActive(INPUT1) Then
Slot = 5
End If
If Not IsActive(INPUT4) And IsActive(INPUT3) And IsActive(INPUT2) And Not IsActive(INPUT1) Then
Slot = 6
End If
If Not IsActive(INPUT4) And IsActive(INPUT3) And IsActive(INPUT2) And IsActive (INPUT1) Then
Slot = 7
End If
If IsActive(INPUT4) And Not IsActive(INPUT3) And Not IsActive(INPUT2) And Not IsActive(INPUT1) Then
Slot = 8
End If
If IsActive(INPUT4) And Not IsActive(INPUT3) And Not IsActive(INPUT2) And IsActive(INPUT1) Then
Slot = 9
End If
If IsActive(INPUT4) And Not IsActive(INPUT3) And IsActive(INPUT2) And Not IsActive(INPUT1) Then
Slot = 10
End If
Wend
Sleep(100)
DeActivateSignal(OUTPUT3) 'stop rotating forward, rotate backward now
End If
SetOEMDRO(824,NewTool)
Code "G4 P2" 'A pause time of 2 seconds to give your reverse turret time to seat
While IsMoving
Wend
End Sub
Main
-
Make sure on your diag page that you can see Inputs 1-4 when you trigger them externally.
scott
-
Make sure on your diag page that you can see Inputs 1-4 when you trigger them externally.
scott
yes i have checked it is working there all four inputs
Ahmed
-
hmmm try reducing your Sleep from 100 to 50 and see if it makes a difference.
Also, RECHECK your logic, make sure you inputs 1-4s conditions do indeed match your slots.
Also, I assume you have a input condition code list of each slot, goto your diangnostic page and rotate
your turret to each slot, make sure that the input LEDs that come on do indeed match your Slot that your using.
if all of that is correct, then I have NO clue why it doesnt work, last case would be to take out the Sleep
all together since mabey your missing the "Inposition" signal.
in the latest dev release Brain said he removed the VBs ability to REV up the processor........ so it may be ok to run it
without the sleep if it doesnt work any other way.
scott