Hello Guest it is March 19, 2024, 02:58:35 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

1941
VB and the development of wizards / Re: center axis rotating axis
« on: March 12, 2018, 07:51:08 AM »
imposed diameter 50 mm
1 touch is withdrawn and second touch
2 rises 50mm (here 'should be half')should be 0.5*Diameter + 10 now
3 moves by 100 mm (too much travel)should be Diameter + 30 now
4 goes down
5 touch is retracted and second touch
6 rises to 100mm (too much travel)should be 0.5*Diameter + 10 now


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 + (0.5*diameter) + 10
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + diameter + 30
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 + (0.5*diameter) + 10
While IsMoving()
Wend


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

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

End Sub









1942
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 ?

1943
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 ?

1944
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






1945
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






1946
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





1947
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 ?

1948
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.

1949
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

1950
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