Hello Guest it is November 15, 2019, 09:21:09 PM

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

841
this code is for right upper Corner?

842
maybe this

Code "G91 G0 Y-.100 X1.0"

y movement is to small, to go down with z axis

this code is for right upper Corner?

843
i guess i mean this code aeria:

   Code "G90 G0 Z.500" 'retract Z to .500 inch
   Code "G91 G0 Y-.100 X1.0"
   Code "G90 G0 Z-.200"
   Code "F" &CurrentFeed 'Returns to prior feed rate
   While IsMoving ()
   Wend

End If

Rem   VBScript For probing In the x- direction

If GetOemLed (825)<>0 Then          'May need to use =0 if it errors
   Call ProbeGrounded()          'Check to see if the probe is already grounded or faulty
   Exit Sub
Else


and specialy here i added a while ismoving() to wait for movement finished before the checking of probe is grounded

844
are you working in metric or imperial?

added a few while ismoving see if this helps

Code: [Select]


Rem   Auto corner finding X-Y-Z-(button3) With tool diameter Input

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825)<>0 Then 'Check to see if the probe is already grounded or faulty
Call ProbeGrounded()
Exit Sub
Else
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' two second delay
Code "G90 G31 Z-1.0 F5" 'Z goes down a max of 1.0 at 5IPM
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2,0.000)
Code "G4 P0.25" 'Pause for Dro to update.
Code "G90 G0 Z.500" 'retract Z to .500 inch
Code "G91 G0 Y-.100 X1.0"
Code "G90 G0 Z-.200"
Code "F" &CurrentFeed 'Returns to prior feed rate
While IsMoving ()
Wend
End If

Rem VBScript For probing In the x- direction

If GetOemLed (825)<>0 Then       'May need to use =0 if it errors
Call ProbeGrounded()          'Check to see if the probe is already grounded or faulty
Exit Sub
Else
Code "G4 P1" 'Pause 1 second to give time to position probe plate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F4"

Rem Probe Left

XNew = GetDro(0) - 3 'probe to current position - 3 inches
Code "G31 X" &XNew
While IsMoving() 'wait for prob move to complete
Wend
XNew = GetVar(2000) 'read the touch point

Rem move back To the hit point incase there was an overshoot

Code "G90 G0 Z.500"
Code "G90 G0 X" &XNew
Code "G91 X-" &CurrentToolDiameter/2  'moves the probe half the tool diameter to center on edge
  While IsMoving ()
Wend
 
Call SetDro (0,0.000)
    Code "G4 P0.25"
    Code "G91 G0 X-.200 Y1.0"
    Code "G90 G0 Z-.200"
Code "F" &CurrentFeed 'restore original feed rate
While IsMoving ()
Wend

End If

Rem VBScript For probing In the Y- direction

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Call ProbeGrounded()
Exit Sub
Else
Code "G4 P1" 'Pause 1 second to give time to position probe plate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F4" 'Slow feedrate to 4 ipm

Rem Probe up

YNew = GetDro(1) - 3 'move to current y position + 3 inches
Code "G31 Y" &YNew
While IsMoving() 'wait for the move to finish
Wend
YNew = GetVar(2001) 'read the touch point

Rem move back To the hit point incase there was an overshoot

    Code "G90 G0 Z.500"
Code "G90 G0 Y" &YNew
    Code "G91 Y-" &CurrentToolDiameter/2  'moves the probe half the tool diameter to center on edge
While IsMoving ()
Wend
    Call SetDro (1,0.000)
    Code "G4 P0.25"
    Code "G90 G0 X0.0"
Code "F" &CurrentFeed 'restore original feed rate
    Code "(X, Y, and Z axis' are now zeroed)"
    Call ReturnG90G91State()
    Exit Sub
End If

Sub ProbeGrounded()
Code "(Probe plate is grounded, check connection and try again)"
Call ReturnG90G91State()
End Sub

Sub ReturnG90G91State()
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
End Sub   

 


 


 


845
the Basic code is still the same you posted at the beginning ?

because in this code is no Z probe only:

X and Y.

make a shot description what the code should do.


846
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









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

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

849
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






850
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