Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: birillo1959 on March 09, 2018, 01:42:09 PM

Title: laser / web centering
Post by: birillo1959 on March 09, 2018, 01:42:09 PM
http://www.machsupport.com/forum/index.php

Speak ("confermare ZERO PEZZO LASER") 'Avviso Vocale
Message "************  INIZIO ZERO PEZZO LASER ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE ZERO PEZZO LASER")


SetUserLED(1103,1) 'close Klause's video window

Call SetOemDRO(3,80) 'reset jog rate to 80%

Xs=GetOemDRO(59) 'read Xscale DRO

Ys=GetOemDRO(60) 'read Yscale DRO

Xmove = -167.890 'enter your camera offset here

Ymove = -46.160  'enter your camera offset here

Code "G91 f500 X" &Xmove & "Y" &Ymove 'make incremental move

While IsMoving () 'wait while that happens

Wend

Code "G90" 'go back to absolute moves

DoOEMButton (1008) 'zero X axis DRO

DoOEMButton (1009) 'zero Y axis DRO

Code " (   HOMING CENTRO COMPLETATO)" 'message for status bar     

Speak ("homing centro completato") 'Avviso Vocale 




I would like if possible to choose whether to go to the center with laser or web, currently I have two buttons one for laser one for web as the coordinates change
Title: Re: laser / web centering
Post by: birillo1959 on March 09, 2018, 03:19:17 PM
I have two buttons one for web center one for laser center I would (if possible) put them in one and choose which one to use, since they change the coordinates

1 botton laser

Speak ("confermare ZERO PEZZO WEB") 'Avviso Vocale
Message "************  INIZIO ZERO PEZZO WEB ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE ZERO PEZZO WEB")



SetUserLED(1103,1) 'close Klause's video window

Call SetOemDRO(3,80) 'reset jog rate to 80%

Xs=GetOemDRO(59) 'read Xscale DRO

Ys=GetOemDRO(60) 'read Yscale DRO

Xmove = -140.000 'enter your camera offset here

Ymove = -32.700 'enter your camera offset here

Code "G91 f500 X" &Xmove & "Y" &Ymove 'make incremental move

While IsMoving () 'wait while that happens

Wend

Code "G90" 'go back to absolute moves

DoOEMButton (1008) 'zero X axis DRO

DoOEMButton (1009) 'zero Y axis DRO

Code " (   HOMING CENTRO COMPLETATO)" 'message for status bar     

Speak ("homing centro completato") 'Avviso Vocale   

-----------------------------------------

2 botton web

Speak ("confermare ZERO PEZZO WEB") 'Avviso Vocale
Message "************  INIZIO ZERO PEZZO WEB ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE ZERO PEZZO WEB")



SetUserLED(1103,1) 'close Klause's video window

Call SetOemDRO(3,80) 'reset jog rate to 80%

Xs=GetOemDRO(59) 'read Xscale DRO

Ys=GetOemDRO(60) 'read Yscale DRO

Xmove = -130.000 'enter your camera offset here

Ymove = -25.700 'enter your camera offset here

Code "G91 f500 X" &Xmove & "Y" &Ymove 'make incremental move

While IsMoving () 'wait while that happens

Wend

Code "G90" 'go back to absolute moves

DoOEMButton (1008) 'zero X axis DRO

DoOEMButton (1009) 'zero Y axis DRO

Code " (   HOMING CENTRO COMPLETATO)" 'message for status bar     

Speak ("homing centro completato") 'Avviso Vocale   
Title: Re: laser / web centering
Post by: TPS on March 10, 2018, 08:09:25 AM
this should do what you want

Code: [Select]

Sub Main
  Begin Dialog SelectCentering 31,32,125,96,"Select Centering"
OKButton 20,68,40,14
CancelButton 70,68,40,14
GroupBox 20,8,72,52,"centering",.GroupBox1
OptionGroup .OptionGroup1
OptionButton 26,24,54,8,"laser",.OptionButton1
OptionButton 26,40,54,8,"web"  ,.OptionButton2
  End Dialog

  Dim Dlg1 As SelectCentering
  Button = Dialog (Dlg1)
 
  If Button = 0 Then Exit Sub
  Selected  = Dlg1.OptionGroup1

  'laser is selected
  If Selected = 0 Then
Speak ("confermare ZERO PEZZO WEB") 'Avviso Vocale
Message "************  INIZIO ZERO PEZZO WEB ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE ZERO PEZZO WEB")
SetUserLED(1103,1) 'close Klause's video window
Call SetOemDRO(3,80) 'reset jog rate to 80%
Xs=GetOemDRO(59) 'read Xscale DRO
Ys=GetOemDRO(60) 'read Yscale DRO
Xmove = -140.000 'enter your camera offset here
Ymove = -32.700 'enter your camera offset here
Code "G91 f500 X" &Xmove & "Y" &Ymove 'make incremental move
While IsMoving () 'wait while that happens
Wend
Code "G90" 'go back to absolute moves
DoOEMButton (1008) 'zero X axis DRO
DoOEMButton (1009) 'zero Y axis DRO
Code " (   HOMING CENTRO COMPLETATO)" 'message for status bar     
Speak ("homing centro completato") 'Avviso Vocale   
  End If
 
  'web is selected
  If Selected = 1 Then
Speak ("confermare ZERO PEZZO WEB") 'Avviso Vocale
Message "************  INIZIO ZERO PEZZO WEB ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE ZERO PEZZO WEB")
SetUserLED(1103,1) 'close Klause's video window
Call SetOemDRO(3,80) 'reset jog rate to 80%
Xs=GetOemDRO(59) 'read Xscale DRO
Ys=GetOemDRO(60) 'read Yscale DRO
Xmove = -130.000 'enter your camera offset here
Ymove = -25.700 'enter your camera offset here
Code "G91 f500 X" &Xmove & "Y" &Ymove 'make incremental move
While IsMoving () 'wait while that happens
Wend
Code "G90" 'go back to absolute moves
DoOEMButton (1008) 'zero X axis DRO
DoOEMButton (1009) 'zero Y axis DRO
Code " (   HOMING CENTRO COMPLETATO)" 'message for status bar     
Speak ("homing centro completato") 'Avviso Vocale     
  End If
   
End Sub





Title: Re: laser / web centering
Post by: birillo1959 on March 10, 2018, 10:15:52 AM
perfect !!! it works very well.
TPS you are a GREAT !!!!!! thanks for your help and patience ;) ;) ;)