1
Brains Development / Re: Brain e/o Script per conteggio e Esecuzione Automatica Azzeramento Assi
« on: January 10, 2019, 11:19:16 AM »
Thanks!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
AUTOHOME
...other gcode..
'AUTOHOME
'1-CONTO N LAVORAZIONI OGNI VOLTA CHE LANCIO IL GCODE
'scrivere a inizio gcode AUTOHOME, che richiama la macro vbscript
'e salvare nel folder delle macro AUTOHOME.m1s
'2-RILANCIO AUTOMATICO DOPO N CICLI DI LAVORO---
'3-RESETTO CONTEGGIO
'MsgBox "debug INIZIO"
Dim NumeroDiPezzi
NumeroDiPezzi=5
'---INCREMENTO CONTEGGIO A OGNI LANCIO DEL GCODE---
'UserDro1400 è var di sistema dove salvo il conteggio
SetUserDro(1400,GetUserDro(1400)+1)
'MsgBox "debug CONTEGGIO=, " & GetUserDro(1400) & "."
Sleep(300)
'---AUTOHOME---
If (GetUserDro(1400) >= NumeroDiPezzi) And Not IsMoving() Then
'MsgBox "debug 24"
DoButton( 24 )
While IsMoving()
Wend
'MsgBox "debug 23"
DoButton( 23 )
While IsMoving()
Wend
'MsgBox "debug 22"
DoButton( 22 )
While IsMoving()
Wend
'MsgBox "debug 25"
DoButton( 25 )
While IsMoving()
Wend
'RESETTO IL CONTEGGIO
SetUserDro(1400,0)
End If
Sleep(300)
'MsgBox "debug FINE"
MsgBox "conferma inizio"
Dim CONTEGGIO As Integer
CONTEGGIO = 0
Dim NumeroDiPezzi
NumeroDiPezzi=50
Dim i
i=0
'While i<100000000
'---CONTEGGIO---
While Not IsMoving() And IsActive(INPUT1) 'INPUT1 è PULSANTE DI AVVIO CICLO
CONTEGGIO = CONTEGGIO + 1
'MsgBox "debug CONTEGGIO=, " & CONTEGGIO & "."
Sleep(5000)
Wend
'---AUTOHOME---
If (CONTEGGIO >= NumeroDiPezzi) And Not IsMoving() Then
'MsgBox "debug AVVIO AUTORIGINE"
DoButton( 24 )
While IsMoving()
Wend
DoButton( 23 )
While IsMoving()
Wend
DoButton( 22 )
While IsMoving()
Wend
DoButton( 25 )
While IsMoving()
Wend
End If
Sleep(300)
'i=i+1
'Wend
'MsgBox "debug fine"
------------------------------------------------------------------------------------------------------------------------------------------------------
MsgBox "conferma inizio"
Dim CONTEGGIO As Integer
CONTEGGIO = 0
Dim NumeroDiPezzi
NumeroDiPezzi=50
Dim i
i=0
'While i<100000000
'---CONTEGGIO---
While Not IsMoving() And IsActive(INPUT1) 'INPUT1 è PULSANTE DI AVVIO CICLO
CONTEGGIO = CONTEGGIO + 1
'MsgBox "debug CONTEGGIO=, " & CONTEGGIO & "."
Sleep(5000)
Wend
'---AUTOHOME---
If (CONTEGGIO >= NumeroDiPezzi) And Not IsMoving() Then
'MsgBox "debug AVVIO AUTORIGINE"
DoButton( 24 )
While IsMoving()
Wend
DoButton( 23 )
While IsMoving()
Wend
DoButton( 22 )
While IsMoving()
Wend
DoButton( 25 )
While IsMoving()
Wend
End If
Sleep(300)
'i=i+1
'Wend
'MsgBox "debug fine"
------------------------------------------------------------------------------------------------------------------------------------------------------