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

1781
VB and the development of wizards / Re: centerpiece full (change)
« on: April 07, 2018, 10:36:47 AM »
i have tested the code from reply #13 again.
it is working perfect here,
so i am out of ideas. sorry.

1782
VB and the development of wizards / Re: centerpiece full (change)
« on: April 07, 2018, 05:04:28 AM »
you can also try to replace

this code:

   Call SetUserDro (1152,YPos2 - YPos1 - CurrentToolDiameter)

by:

   Call SetUserDro (1152,YPos2 - YPos1 - (CurrentToolDiameter/2))

1783
VB and the development of wizards / Re: centerpiece full (change)
« on: April 07, 2018, 05:02:48 AM »
if you push your probe by Hand, is it switching imediately, or maybe after 3mm push ?

1784
i think you do a Manual toolchange ?

than you have in Config -> General Config

panel Tool Change
option -> Stop Spindle Wait for Cycle Start enabled.

1785
General Mach Discussion / Re: Mach 3 - driving beyond soft limits ?
« on: April 07, 2018, 04:11:07 AM »
are you sure that softlimits had been turned on?

1786
VB and the development of wizards / Re: centerpiece full (change)
« on: April 07, 2018, 03:22:38 AM »
ok i have tested the following code here on my machine,
and it showed allway the correct diameter, did about 10 runs.

Code: [Select]
Rem VBScript To center probe outside diameter Metric Version
Speak (" psizionarsi CINQUE millimetri sopra il pezzo") 'Avviso Vocale
response = MsgBox ("   5 mm    SOPRA IL PEZZO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo pieno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO PIENO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO PIENO")
 
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

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F50" 'slow feed rate to 100mm/sec
    Code "G90 G0 X" &XNew + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Left

    XNew = Xcurrent - OutsideDiameter * .6
    Code "G31 X" &XNew
    While IsMoving() 'wait for the move to finish
    Wend
    XPos1 = GetVar(2000) 'get the probe touch location
    Code "G91 G0 X2"
    Code "G91 G0 Z10"
    Code "G90 G0 X" &XCurrent 'rapid move back to start point
    Code "G91 G0 X" &XCurrent - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Right

    XNew = XCurrent + 75 'probe 75mm to right
    Code "G31 X" &XNew
    While IsMoving()
    Wend
    XPos2 = GetVar(2000)
    Code "G91 G0 X-2"
    Code "G91 G0 Z10"
    XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
    Code "G90 G0 X" &XCenter 'rapid move to the x center location
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    Code "G4 P0.25"
    Code "G90 G0 Y" &YNew - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe up

    YNew = YCurrent + 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos1 = GetVar(2001)
    Code "G91 G0 Y-2"
    Code "G91 G0 Z10"
    Code "G90 G0 Y" &YCurrent
    Code "G91 G0 Y" &YCurrent + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe down

    YNew = YCurrent - 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos2 = GetVar(2001)
    Code "G91 G0 Y2"
    Code "G91 G0 Z10"
    YCenter = (YPos1 + YPos2) / 2

Rem move To the center

    Code "G90 G0 Y" &YCenter
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    While IsMoving ()
    Wend
    Call SetUserDro (1152,YPos2 - YPos1 - CurrentToolDiameter)

MsgBox "diameter: " &GetUserDro(1152) &" mm"   
   
    Code "G4 P0.25"

    Code "F" &CurrentFeed 'restore starting feed rate
   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 


1787
so it Looks like you have no tool change selected in Config -> General Config,
or no code in M6Start macro.

for a Minimum you Need

 tool = GetSelectedTool()
 SetCurrentTool( tool )

in M6Start


1788
VB and the development of wizards / Re: centerpiece full (change)
« on: April 06, 2018, 11:30:31 AM »
courious, because the messagebox Shows only the coordinates where the probe was hit and the Diameter of the probe.


from the data it Looks like 70mm not 80mm  ???


when you watch axis dro's are they about +- 38mm when the probe is hit ?

1789
VB and the development of wizards / Re: centerpiece full (change)
« on: April 06, 2018, 11:10:54 AM »
can you mofify the code:

msgbox  "YPos2: " &YPos2 & " YPos1: " &YPos1 & "Tooldiamter: " &CurrentToolDiameter   


to:

msgbox  "XPos2: " &XPos2 & " XPos1: " &XPos1 & "Tooldiamter: " &CurrentToolDiameter   

1790
i have tested this code here:

Code: [Select]
tool = GetSelectedTool()
Dim UsersName As String
UsersName = AskTextQuestion("Please enter your name:")
Message "Please change tool now" & UsersName & "!"
MsgBox "Current tool at start of change is "    & GetSelectedTool()
SetCurrentTool( tool )

run fine.

post a copy of your M6Start as an attachment, probably there are characters you do not see
in a normal text Editor.