Hello Guest it is November 26, 2020, 04:41:18 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 - TPS

1221
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 07:43:30 AM »
or are we talking about y-axis distance ?

1222
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 07:34:35 AM »
it should start with at z 0,

and raise z for the entered Diameter.

how much does z raise ?

1223
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 07:22:36 AM »
sorry code was wrong , here the new one:

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
  
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub






1224
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 06:47:14 AM »
here with half the height

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
   
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub






1225
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 06:17:06 AM »
try this.
please test carefully, not tested.

y-axis must be in front of (-) part in a-axis, z-axis in height to probe.

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
  
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub





1226
but if you go to diagnostic Screen you can see the digitize LED working,
Off if your probe is free, ON if you touch your probe to te plate ?

1227
copy your code into VB Scripter window.
use the ||> step button and step through the code,
than you will see exactly when the error occurs.

1228
General Mach Discussion / Re: Mach3 Pendant
« on: March 11, 2018, 06:23:44 AM »
ok there is not much what can go wrong in this brain.

i have no idea why this is Happening.

i would in a first step add a and to eatch rung

oemtrigger1 AND LED15(step mode) AND LED83 (Jog on) = MPG1 JogX

Thomas

1229
VB and the development of wizards / Re: laser / web centering
« 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






1230
VB and the development of wizards / Re: center hole script
« on: March 09, 2018, 11:50:01 AM »
have a try this does what you want.

Code: [Select]
Speak ("ricerca centro pezzointerno") 'Avviso Vocale
Message "RICERCA CENTRO PEZZO INTERNO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE RICERCA CENTRO PEZZO INTERNO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo interno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO INTERNO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO INTERNO")


  
Call SetDRO(0,0)
Call SetDRO(1,0)
Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp

Code "G31 X" & (GetParam("XDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 X" & (GetParam("XDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 X" & (GetParam("XDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("XDRO")

Code "G0 X" & Xpos

Code "G31 X" & (GetParam("XDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 X" & (GetParam("XDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 X" & (GetParam("XDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("XDRO")

measuredX = B-A

Code "G0 X" & (A+(B-A)/2)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & Ypos

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")

measuredY = B-A

Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox (" Measurement X: " & nFmt(measuredX,3) & " mm  Measurement Y: " & nFmt(measuredY,3) & " mm")


the Measurement Y sjould be the Diameter of hole - Probediamater