Rem VBScript Sensor Probe para eixo Z AutoToolZero 'WWW.MACHSUPORTE.COM.BR 'INICIO VARIAVEIS ZProbe = -20.00 'Profundidade Z de leitura do Probe ZFeed = 50 'Feed-Rate Z de leitura do Probe ZOffset = 1.00 'Altura do Probe - Da peca ate em cima do Probe ZUp = ZOffset + 3.00 'Depois que o Probe faz contato, sobe 2 mm + a altura da sonda. StopZmove = 0 If GetOemLed (825) <> 0 Then 'Checa se o Probe ja está ligado ou faltante Code "(Probe ja ligado! cheque a conexao e tente novamente)" Else CurrentFeed = GetOemDRO(818) 'Get current feedrate DoSpinStop() 'Desliga Spindle DoOEMButton (1010) 'Zera o Z 'init code Code "G4 P2.0" 'Pausa de 2 Segundos Code "(Escaneando Probe...)" Code "G31 Z" &ZProbe & "F" &ZFeed While IsMoving() Sleep(200) Wend Probepos = GetVar(2002) If Probepos = - ZProbe Then responce = MsgBox ("**ERRO** Sonda nao detectou nada!") Code "G0 Z10" StopZmove = 1 Code "F" &CurrentFeed End If If StopZmove = 0 Then Code "G0 Z" &Probepos While IsMoving () Sleep (200) Wend End If Call SetDro (2, ZOffset) 'Set DRO-Z as VAR ZOffset Code "G4 P1" Code "G0 Z" &ZUp Code "(Z Zero OK - machsuporte.com.br)" Code "F" &CurrentFeed End If