Hello Guest it is December 26, 2024, 11:44:42 AM

Author Topic: Tool change macro  (Read 13168 times)

0 Members and 1 Guest are viewing this topic.

Offline N4NV

*
  •  398 398
Re: Tool change macro
« Reply #10 on: February 01, 2009, 05:52:28 PM »
The brain to for the PLC looks like this:

Current tool -->No Operation pass signal-->MOD:0-P:16

As soon as the current tool number changes, that is sent to the PLC via modbus.  As long as the current tool has not changed, the PLC does nothing.

Actually, the brain is constantly sending the current tool number to the PLC, but if the tool number sent is the same as the current tool on the turret the PLC does nothing.

Vince

Offline zealous

*
  •  489 489
  • HI!
    • Artsoft Solutions
Re: Tool change macro
« Reply #11 on: February 01, 2009, 08:20:29 PM »
I think the best is to set a USERLED to tell the Brain it is time to rotate.

In your Brain have it look for LED2000
If LED2000 is true and tool# is not equal to current tool then get tool.

Anyways here is the complete code for something like that in your Macro:

Code: [Select]
'////MOVE THE MACHINE FOR TOOLCHANGE////
Code ("G53 G00 Z-0.200")'Move Z to position

While IsMoving() ' Wait for machine to stop
SLEEP(250)'Slow down cycle time for CPU resources
Wend

'MsgBox "Machine finished moving"

'//GET SET TOOL////
tool = GetSelectedTool() 'Gettool
SetCurrentTool( tool )'Set tool

Call SetUserLED(2000,1)'Activate Brain

'///Time wait for INPUT1
i=0'Reset timmer

Do 'Run timmer

SLEEP(500)'timmer 1/2 second intervals

 i= i+1'increment
 
 
If (IsActive(INPUT1)) Or GetOEMLED(800) Then'INPUT is active
 
  Exit Do  'exit function Continue
 
ELSEIf i>8 Then'if we have reached 4 seconds
 
 
'///Message box////
msg = "Please reseat tool and continue?"   ' Define message
title = "Tool Changer"   ' Define title
buttons = 1

response = MsgBox(msg,buttons, title)'Display message box

'///Responce was YES
If response = 1 Then' User chose Yes.

   'OK has been pressed continue
   
Else'///Responce was NO

     DoOEMButton(1021)'Estop system
     
     
End If'exit message


Exit Do  'exit function
 
End If 'INPUT ACTIVE
 
Loop



Offline N4NV

*
  •  398 398
Re: Tool change macro
« Reply #12 on: February 01, 2009, 08:23:24 PM »
Thanks, I will give a brain for that a try.

Vince

Offline zealous

*
  •  489 489
  • HI!
    • Artsoft Solutions
Re: Tool change macro
« Reply #13 on: February 01, 2009, 08:31:30 PM »
Great  ;D
You shouldnt have any problem setting the LED in the Brain.
Its too bad Hoods SetModOutput will not work because you could just do it all from the macro without a brain  ;)