Hello Guest it is April 25, 2024, 06:29:23 AM

Author Topic: Help to finish a button  (Read 3170 times)

0 Members and 1 Guest are viewing this topic.

Offline Alexi

*
  •  10 10
    • View Profile
Re: Help to finish a button
« Reply #10 on: February 18, 2021, 09:30:39 AM »
Code: [Select]
'*** turn soflimit's off if they are on

Dim SoftLimitswhereon As Boolean

If GetOEMLed(23) Then
   DoOEMButton(119)
   SoftLimitswhereon = True
End If

If GetOEMLed(832) then
    Code "G91 G1 Z-10 F100"
    Code "G90"
    While IsMoving()
    Wend
End If

Dobutton( 24 ) ' ZeroZ

While IsMoving()
Wend

Sleep 500

ZDRO = 85 'variavel dro maquina
ZWDRO = 2 'variavel dro trabalho

Z = GetOEMDRO( ZDRO ) 'passa o valor do dro maquina
Call SetDro (ZWDRO, Z) 'passa o valor do dro maquina

Sleep 500

'clear x-axis Limit Switch if needed
If GetOEMLed(830) then
    Code "G91 G1 X10 F100"
    Code "G90"
    While IsMoving()
    Wend
End If

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

'clear y-axis Limit Switch if needed
If GetOEMLed(831) then
    Code "G91 G1 Y10 F100"
    Code "G90"
    While IsMoving()
    Wend
End If

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

'*** turn soflimit's back on if they where on

If ((Not GetOEMLed(23)) And (SoftLimitswhereon = True)) Then
   DoOEMButton(119)
   Sleep(500)
End If

Code   "( ZERO DONE )" 

I forgot that one and i could`t test it yet, the factory still closed.
Now i think it is done

Thanks