Hello Guest it is April 25, 2024, 04:38:09 AM

Show Posts

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.


Messages - mike^3

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 »
41
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 18, 2015, 06:35:44 AM »
I am trying both types of code....I'm kind of stumped....when the cam puts out gcode it will put out t1m6 or t010 correct?

42
I tried that doesn't work....it still does not pause after deactivating output 5....any other wait functions?

43
Hi everyone! you are all great! I appreciate all help. Im getting really frustrated with this...  ??? ??? ???

Heres my problem, in this macro the second wait command does not happen, even though I think it is written properly. Please take a look


Here is the code that I have, it works fine but it will not wait after it senses the right input, I put ****** by it...



I only added the ****** for the first two cases, but not the rest, its the same thing for the rest. Perhaps the wait commands are not put in properly?



The first whileismoving() works fine but the second one does not work, it doesnt even wait... Any ideas?



'Macro ATC turret V2.02.01


Sub MovePos(ByVal ToolNumber As Integer)

OldTool = GetCurrentTool()

NewTool = GetSelectedTool()

ToolNumber = NewTool

If NewTool = OldTool Then

Message" Same Tool, NO ACTION"

End

End If

If NewTool > 8 Or NewTool < 1 Then

MsgBox" Tool # Not a Valid Number 1-8 ONLY, ENDING Program RUN "

DoButton(3)

End

End If

Tcount = 0

Select Case ToolNumber 'Position to each tool number by input signal

 

 

Case = 1

Message" Select Tool #1 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000 ******************it will wait here fine...

Wend


ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = true And GetOemLed(822) = false And GetOemLed(823) = false And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000 **********************It does not wait here for some reason***************

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"


End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop




message " Tool #1 Loaded"


''*****************************************************************

Case = 2

Message" Select Tool #2 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000 *************waits ok

Wend


ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = false And GetOemLed(822) = true And GetOemLed(823) = false And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000  **********************it does not wait

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop


message " Tool #2 Loaded"


''*****************************************************************

Case = 3

Message" Select Tool #3 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend



ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = true And GetOemLed(822) = true And GetOemLed(823) = false And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop

message " Tool #3 Loaded"


''*****************************************************************

 

Case = 4

Message" Select Tool #4 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend



ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = false And GetOemLed(822) = false And GetOemLed(823) = true And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop


Message " Tool #4 Loaded"


''*****************************************************************

Case = 5

Message" Select Tool #5 "



ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend


ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = true And GetOemLed(822) = false And GetOemLed(823) = true And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop

message " Tool #5 Loaded"


''*****************************************************************

Case = 6

Message" Select Tool #6 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend



ActivateSignal(Output6) 'Start Turret


Tcnt = 0

 

Do Until GetOemLed(821) = false And GetOemLed(822) = true And GetOemLed(823) = true And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If



'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop

message " Tool #6 Loaded"


''*****************************************************************

Case = 7

Message" Select Tool #7 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend


ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = true And GetOemLed(822) = true And GetOemLed(823) = true And GetOemLed(824) = false Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop

message " Tool #7 Loaded"


''*****************************************************************

Case = 8

Message" Select Tool #8 "


ActivateSignal(Output5) 'Releases stop dog


While IsMoving()

Sleep 1000

Wend


ActivateSignal(Output6) 'Start Turret


Tcnt = 0

Do Until GetOemLed(821) = false And GetOemLed(822) = false And GetOemLed(823) = false And GetOemLed(824) = true Or Tcnt > 200000

Tcnt = (Tcnt+1)

Loop


If Tcnt >= 200000 Then

DoButton(3)

DeActivateSignal(Output5) 'Stopping turret

DeActivateSignal(Output6) 'Lowering and stopping air motor

MsgBox" Tool Turret Timed Out not receieving input signal from turret encoder"

End


Else


DeActivateSignal(Output5) 'Trigger Stop Dawg

Message"Triggering Stop Dawg"

While IsMoving()

Sleep 2000

Wend


DeActivateSignal(Output6) 'Lowering and stopping air motor

Message"Lowering and stopping air motor"

End If


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


Tcnt2 = 0


Do Until isactive(29) ' Check for reseating of turret

Tcnt2 = (Tcnt2 +1)

If Tcnt2 > = 10000 Then

DoButton(3)

MsgBox(" Turret Timed Out and Did Not Reseat")

End

End If

Loop

message " Tool #8 Loaded"

''********************************************************************

End Select


SetOemDro(824,NewTool)

End Sub

End


44
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 17, 2015, 08:23:45 AM »
I think I follow ya, but, When I put in the MDI line T0101 (it means in mach 3, change to tool 1 with offset 1), it activates the tool change macro.

The macro needs to see the inputs and goto them accordingly... I mapped the inputs to the table seen above, how we want to hangle those inputs is up for grabs, just need to call a tool, then sense the inputs, then stop the tool, and update the tool and keep running program...




45
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 17, 2015, 07:37:29 AM »
Here is how the turret works...

The encoder puts out a series of signals, on active pins 1-4,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
1              1          0            0         0
2              0          1            0         0
3              1          1            0         0
4              0          0            1         0
5              1          0            1         0
6              0          1            1         0
7              1          1            1         0
8              0          0            0         1

So if you see above, the macro needs to get selected tool.

Activate output 5
wait 1 sec
Activate output 6

' now is needs to find the right tool, for example if I wanted tool one, I put in t0101, then using the above table, the macro needs to sense that Active 1 is (HI) and active 2, 3, and 4, are (LOW), this indicates its at tool one,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
1               1           0           0            0

Then deactivate output 5
wait 1 sec
deactivate output 6
wait for oemtrigger for turret seated,
then continue program.

Same for tool 2-8, one more example: If I wanted tool 7, I put in t0707 on the mdi line, then using the above table, the macro needs to sense that Active 1,2 and 3, is (HI) and active 4, is (LOW), this indicates its at tool seven,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
7              1           1           1            0

Does this clarify it a bit :)? Any ideas as to the macro needed? THANK YOU!

46
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 17, 2015, 07:05:28 AM »
Ohh ya... it needs to know, I thoughts that's what was in the program haha.


47
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 16, 2015, 10:04:46 PM »
would that make any difference as to repeatability? .... let me try it and see...

48
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 16, 2015, 07:05:19 PM »
Well, it does work great, however, turret change is not repeatable. Meaning when I call for t0101 it could goto tool 2/6/3 etc. there is no repeat able way for this.

So I was thinking,

Can I just run 1 wire for each tool change position?, would you know what the code would be?

I would make each input oemtrigger 1-8 and the tool changer down switch to active 1.

I am thinking mach3 cant add the inputs nicely enough to make it work.

Or plc?

49
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 13, 2015, 06:02:46 AM »
Wow sir, u are awesome!!! Thank u so very much!

50
General Mach Discussion / Re: CNC Lathe turret tool changer help?
« on: October 12, 2015, 06:48:38 PM »
I looked in mach3 for inputs and they only have inputs 1-4 that's why I mentioned oemtrigger1

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 »