Hello Guest it is April 19, 2024, 08:53:44 AM

Show Posts

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.


Messages - MircoCdc

Pages: 1
2
Syntax question to call the macro in GCODE:
in GCODE to call the macro AUTOHOME.m1s i have to:
1-save the file in the folder C:\Mach3\macros\Mach3Mill
2-write in GCODE file:

Code: [Select]
AUTOHOME
...other gcode..

but i have an ERROR when i load the file in mach3:
'Unknown word where unary operation could be, Block AUTOHOME'.

What it means?
The name of the macro have to be necessary M****.m1s ?

3
If someone need  a script to make AUTOHOME i leave this tested example code:

Code: [Select]
'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"

4
Thanks for Reply!!


I test this macro vbscript and it work with UserDro , the value is stored, TANKS!

Another question:
how i can launch the macro everytime i have INPUT#1 = TRUE ?

(Sorry!! I read better and i see that you told me to put the macro in the GCODE file. Thanks!!)

5
Hi everyone, :)
I would need a hand to realize this simple functionality with Brain and / or VBScript .:

FUNCTIONALITY
After a certain number of operations, counted by INPUT1, I automatically start an axis zeroing, I run the home of the two axes.
I would need a hand to do:
1-COUNTING (number of times I pressed the cycle start button (INPUT1)
2-LAUNCH HOME (WITH CHECK THAT I'M NOT MOVING AND I HAVE NO WORKING IN PROGRESS)

QUESTIONS
1-COUNTING would you give me a hand to do the BrainDiConteggio?
I saw that the variables of VBscript are without memory, so I can not save the number of times I press the start button cycle (INPUT1), so I'm trying with a Brain but I can not do the count .. someone can give me a but no? HELP !!!
2-LAUNCH HOME
Is it convenient to do everything from Brain using system functionality to launch homing?
Or can I call a VBScript from a Brain?
Because if I can run a script from the BrainDiConteggio, I can use the code below to launch home.




TESTS
place some VBScript code tests that may come in handy to explain what I would like to do as logic:

----------------------------------------------------------TEST VBScript--------------------------------------------------------
Code: [Select]
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"
------------------------------------------------------------------------------------------------------------------------------------------------------

6
Ciao a Tutti, :)
mi servirebbe una mano per realizzare questa semplice funzionalita con Brain e/o VBScript.:

FUNZIONALITA
Dopo un certo numero di lavorazioni , conteggiabili da INPUT1, lancio in automatico un azzeramento assi, faccio eseguire l'home dei due assi.
Mi servirebbe una mano per fare:
1-CONTEGGIO (numero di volte che ho premuto il pulsante di avvio ciclo ( INPUT1 )
2-LANCIO HOME  ( CON VERIFICA CHE NON MI STO MUOVENDO E NON HO UNA LAVORAZIONE IN CORSO)

DOMANDE
1-CONTEGGIO mi dareste una mano per fare il BrainDiConteggio?
Ho visto che le variabili del VBscript sono senza memoria, quindi non ci posso salvare il numero di volte che premo il pulsante di avvio ciclo ( INPUT1 ), quinidi sto provando con un Brain ma non riesco a fare il conteggio.. qualcuno puo darmi una mano? HELP!!!
2-LANCIO HOME
Conviene fare tutto da Brain usando funzionalita di sistema per lanciare homing?
Oppure posso richiamare un VBScript da un Brain?
Perche se posso lanciare uno script dal BrainDiConteggio,  posso usare il codice qui sotto per lanciare home.




PROVE
posto delle prove di codice VBScript che possono tornare utili per spiegare cosa vorrei fare come logica:

----------------------------------------------------------Prova di codice VBScript--------------------------------------------------------
Code: [Select]
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"
------------------------------------------------------------------------------------------------------------------------------------------------------

Pages: 1