Hi there to all,
this is not my comfort area and is far from it, but in this crazy times found something that can improve my knowledge and simplify my work, so i am trying to create a button that does the starting routine that i always need to make when i start my machine
My manual routine is:
First press RESET button
Second press REF ALL HOME
Third press GO TO ZERO
fourth press zero x, zero y, and zero z (machine coordinates and work coordinates equal to zero )
Five press SOFT LIMITS
After this my machine is ready to safely work.
This is the script that i create:
Code "( STARTING MACHINE )"
DoOEMButton(119)
Dobutton( 24 ) ' ZeroZ
While IsMoving()
Wend
Sleep 300
ZDRO = 85 'var dro machine
ZWDRO = 2 'var dro work
Z = GetOEMDRO( ZDRO ) 'passa o valor do dro maquina
Call SetDro (ZWDRO, Z) 'passa o valor do dro maquina
Sleep 500
Dobutton( 22 ) ' Zerox
While IsMoving()
Wend
Sleep 500
XDRO = 83 'variavel dro maquina
XWDRO = 0 'variavel dro trabalho
X = GetOEMDRO( XDRO ) 'passa o valor do dro maquina
Call SetDro (XWDRO, X) 'passa o valor do dro maquina
Sleep 500
Dobutton( 23 ) ' ZeroY
While IsMoving()
Wend
Sleep 500
YDRO = 84 'variavel dro maquina
YWDRO = 1 'variavel dro trabalho
Y = GetOEMDRO( YDRO ) 'passa o valor do dro maquina
Call SetDro (YWDRO, Y) 'passa o valor do dro maquina
Sleep 500
Code "G28"
While IsMoving()
Wend
Sleep 500
DoOEMButton(119)
Code "( ZEROS DONE )"
So my questions are:
Is it safe to use?
Sometimes it doesn't work and it gives me error "limit switch triggered", and stops script. In this case i have to
manually remove axis from switch that triggers.What can it be?
Any tips to improve this are more then welcome.
Thanks to all
Alex