Hello Guest it is April 19, 2024, 09:57:59 AM

Author Topic: Terminating Script  (Read 12401 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Terminating Script
« Reply #10 on: January 16, 2008, 03:55:54 PM »
ok try this it is a combination of Brains, the macropump and your custom macro.

Put the following in the Macro pump and the other part in your M555, then turn on macro pump and reboot mach.

'Macro Pump

If GetUserLED(2001) Then
Message("Z in position for tool change")
SetUserLED(2000,0)
SetUserLED(2001,0)
end If

If GetUserLED(2002) Then
Message("ERROR - Switch is not triggered")
SetUserLED(2002,0)
SetUserLED(2003,0)
end If

'This next stuff goes in your M555.
'M555 here is your intiating macro (or you can use M6)

SetUserLED(2000,1)
SetUserLED(2003,1)
code "G01 G53 Z201 F1000"  'this moves in Machine coordinates
While IsMoving()
WEnd

Download the brain zip file and unzip, put it in your brain folder, from within mach, goto operator, goto brain control and enable the brain called. ATC_Zaxis.brn, hit the view button and then test your system by loading the M555 in your MDI line.

give us feedback.

scott
fun times
Re: Terminating Script
« Reply #11 on: January 17, 2008, 02:04:00 PM »
Hello,

I have work on first code and I find a problem.

The problem is: DooemButton(1003) ' Stop Button
This is the cause for "Terminating Script"
If I put any other OEM Button  all works fine.

If I try to stop moving with DooemButton(1001)  'Pause - Hold , moving stops but it takes too long (~ 90mm) also if I set deceleration to
very small value - 0.4 s (the speed of moving is 1500 mm/min).

I have try also  DooemButton(1002) 'Rewind   The axis stops but then takes too long before  continue with other code.

Is there any other way to stop moving when switch is triggered?
Our machines are with servos, so  quick stop (without long deceleration) isnĀ“t  a problem.




Thanks all for your help.