Hello Guest it is May 04, 2024, 12:43:42 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

1771
on page 30/31 is a good descripton:

1772
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 01:08:24 PM »
just in case, that was the modes witch where active during the test

1773
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 12:45:12 PM »
Hi Dave,

i tested again this code on a V066 Setup in VB Scripter Window

Code: [Select]
Sub Main()
'***Y+ Probing Macro
'***Written by and for DD Metal Products Ltd 2018
'***Metric units only in use
'***Using CSLABS Controller M31 macro code
'***Axis scaling not expected or handled
'***Probe offset must be calibrated at "Slow Feedrate" value and set in "Probe Tip Dia" DRO first
'***Probe Z axis position is set by user first to correct height
'***Probe Y position must be within the value set in "Max Distance" DRO

Dim FeedFast, FeedSlow
Dim ProbeOffset
Dim MaxDistance
Dim X_SENSE As Double
Dim Y_SENSE As Double
Dim Z_SENSE As Double
Dim CurrentAbsInc

'***Load Variables From Screen DRO's
FeedFast = GetUserDRO(1821)
FeedSlow = GetUserDRO(1822)
MaxDistance = GetUserDRO(1823)
ProbeOffset = GetUserDRO(1829)

'TPS i do not have the DRO
FeedFast = 50
FeedSlow = 5
MaxDistance = 30
ProbeOffset = 5




'***Error checks
If GetOemLed(16)<>0 Then '***Check for machine coordinates setting
  Message "Please Change To Working Coordinates"
  Exit Sub
End If

If GetOemLed(825)<>0 Then '***Probe is not connected or cable broken
  Message "Probe Connection Error"
  Exit Sub
End If

'***Get the current G90/G91 state
CurrentAbsInc = GetOemLED(48)  


'***Start Probing
Message "Probing In Y+ Direction"
Sleep (1000)

Code "F" & Feedfast

SetUserDRO(1511, 0) '***X Axis
SetUserDRO(1512, MaxDistance) '***Y Axis
SetUserDRO(1513, 0) '***Z Axis

Call ProbeSurface()

X_SENSE = GetVar(2000)
Y_SENSE = GetVar(2001)
Z_SENSE = GetVar(2002)

Code "G91 G0 Y-3" '***Step back
While IsMoving()
  Sleep(50)
Wend

Code "F" & FeedSlow

SetUserDRO(1511, 0) '***X Axis
SetUserDRO(1512, 5) '***Y Axis - Must be within 5mm of travel
SetUserDRO(1513, 0) '***Z Axis

Call ProbeSurface()

X_SENSE = GetVar(2000)
Y_SENSE = GetVar(2001)
Z_SENSE = GetVar(2002)

'***Step back to release the probe
Code "G91 G0 Y-5"
While IsMoving()
  Sleep(50)
Wend

'***Raise the spindle to clear part
Code "G91 G0 Z10"
While IsMoving()
  Sleep(50)
Wend

'***Move Y axis to edge and zero the DRO
Code "G90 G0 Y" & Y_SENSE + ProbeOffset
While IsMoving()
  Sleep(50)
Wend
SetOemDRO(801,0)

'***Retract the spindle fully
'Code "G53 G0 Z0"
'While IsMoving()
'  Sleep(50)
'Wend

'***If G91 was in effect before then return to it
If CurrentAbsInc = 0 Then
  Code "G91"
Else
  Code "G90"
End If

Message "Y+ Probing Complete"

End Sub




Sub ProbeSurface()

'*** turn soflimit's off if they are on
Dim SoftLimitswhereon As Boolean
If GetOEMLed(23) Then
DoOEMButton(119)
SoftLimitswhereon = True
End If

Sleep(250)'***Needed or UserDRO's fail to update

NotifyPlugins(10103)

SetUserDRO(1510, 0)
While(GetUserDRO(1510) = 0)
  Sleep(50)
  NotifyPlugins(10104)
Wend

If(GetUserDRO(1510) = 2) Then '***Probing error - no detection in distance = abort
  Message "Probing Error - No Surface Found"
End If

'*** turn soflimit's back on if they where on
Sleep(500)
If ((Not GetOEMLed(23)) And (SoftLimitswhereon = True)) Then
DoOEMButton(119)
End If

End Sub



10 times in row, softlimits off, no Problem.

Thomas

1774
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 11:54:37 AM »
allow me a question in own interest.

is it possible that you edited this code with a MAC?

1775
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 11:40:55 AM »
ok made two screenshots of HexEdit , hope it makes it clearer

1776
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 11:31:36 AM »
from  ’   to   '  , sorry don't the english word for it.

copy the original code:

Sleep(250)’***Needed or UserDRO's fail to update


into notepad++, enable language VB script, and you will see the the comment is not recognized as comment.

line get's green starting from here: 's fail to update

Thomas

 

1777
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 11:22:58 AM »
and yes probing drives cracy if softlimits are enabled,
so i midified your probing function a Little bit:

Code: [Select]
Sub ProbeSurface()

'*** turn soflimit's off if they are on
Dim SoftLimitswhereon As Boolean
If GetOEMLed(23) Then
DoOEMButton(119)
SoftLimitswhereon = True
End If

Sleep(250) '***Needed or UserDRO's fail to update

NotifyPlugins(10103)

SetUserDRO(1510, 0)
While(GetUserDRO(1510) = 0)
  Sleep(50)
  NotifyPlugins(10104)
Wend

If(GetUserDRO(1510) = 2) Then '***Probing error - no detection in distance = abort
  Message "Probing Error - No Surface Found"
End If

'*** turn soflimit's back on if they where on
Sleep(500)
If ((Not GetOEMLed(23)) And (SoftLimitswhereon = True)) Then
DoOEMButton(119)
End If

End Sub

ok now i will allso modify my probing libary ;)

Thomas

1778
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 10:36:28 AM »
ok tryed to run your posted code.
gave me scripter Compiler error:


Sleep(250) ***Needed or UserDRO's fail to update

changed it to:


Sleep(250) '***Needed or UserDRO's fail to update

then it run fine on V022 and V066

Thomas



1779
General Mach Discussion / Re: Probing - what would i need?
« on: April 11, 2018, 03:08:52 AM »
Yes, but no - I used the exact M31 code but put it inline with my own macro so i didn't need to risk calling a macro from within a macro:)

that was the reason, why i included the original M31code into my functionlibary as a function (function Probe, in the file i posted).

if you post your code, then i will run it during the afternoon on my machine.
  
I did ask CS labs but their support is terrible.

i have allways written to a CSLab guy called Wojtek, and got allways a answer within 48h,
ok that's not even fast.

1780
General Mach Discussion / Re: Z moves up down up after tool change?
« on: April 11, 2018, 01:41:08 AM »
it depends on what you have selected in Config -> General Config -> Tool Change

if you have selected: Stop Spindle Wait for Cycle Start , what would be the right choice for Manual tool Change,

Mach will run the M6Start macro first, and after you have pressed Cycle Start the M6End macro.

So the code of both macros is important for a tool Change.