Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 11:52:56 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Modifing Operator Editable Button Macros
Pages: « 1 2   Go Down
Print
Author Topic: Modifing Operator Editable Button Macros  (Read 1225 times)
0 Members and 1 Guest are viewing this topic.
airnocker
Active Member

Offline Offline

Posts: 36


View Profile
« Reply #10 on: July 27, 2010, 05:48:43 PM »

Here is the other picture that would not upload in my last post.


* TouchPlate-3s.JPG (101.03 KB, 800x600 - viewed 31 times.)
Logged

airnocker
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #11 on: July 27, 2010, 08:21:39 PM »

Looks good Airnocker

If you are thinking others may pick up this macro and use it then I would advise putting either;

DoOEMButton (1008)

or

SetOEMDRO (800,0)

at the beginning of each probe section (with appropriate number), followed by a "Sleep 100"

Save a bit of grief. Smiley

Greg
« Last Edit: July 27, 2010, 08:25:19 PM by Greolt » Logged
airnocker
Active Member

Offline Offline

Posts: 36


View Profile
« Reply #12 on: July 27, 2010, 08:52:09 PM »

Thanks Greg.

Do you mean like this?  Good catch, I forgot SetDRO is going out of style.

Version3

Sub Main()

Dim ConfirmReady As String
Dim DoXY As String
Dim DoZ As String

ConfirmReady = AskTextQuestion("Confirm Touch plate leads are connected and ready. (y/n)")
If ConfirmReady = "y" Then GoTo 1 Else GoTo 5


1:
DoXY = AskTextQuestion("Zero X and Y also? (y/n)")
If DoXY = "y" Then GoTo 2 Else GoTo 3


2:
Message( "Auto Zeroing X..." )
If IsSuchSignal (22) Then
   code "G31 X-2 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 800, .0625 )
                Sleep 100
   code "G1 X.5"
End If

Message( "Auto Zeroing Y..." )
If IsSuchSignal (22) Then
   code "G31 Y-1 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 801, .0625 )
   Sleep 100
   code "G1 Y.5"
End If

3:
DoZ = AskTextQuestion("Position the touch plate to zero Z.  y  to continue or n to skip.  (y/n)")
If DoZ = "y" Then GoTo 4 Else GoTo 6

4:
Message( "Auto Zeroing Z..." )
If IsSuchSignal (22) Then
   code "G31 Z-2 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 802, .180 )
   Sleep 100
   code "G1 Z1"
End If
GoTo 6

5:
Message ("Tool zeroing aborted.  Try again when ready.")
GoTo 7

6:
Message "Tool zeroing complete.  Check the results on the DROs."

7:
End Sub
End

Logged

airnocker
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #13 on: July 27, 2010, 09:09:36 PM »

No.

What I meant was, it is a good idea to zero the axis DRO before calling the probe move.

You will get users trying the script and saying "why does mine sometimes probe in the wrong direction?"

They may not manually zero the axis and say it is at -2 before the probe move.

The probe move might be "G31 Z-1".  If they are in G90, then it will unexpectedly go in the wrong direction.

I have seen this exact scenario come up on the forum many times. Smiley

Greg
Logged
airnocker
Active Member

Offline Offline

Posts: 36


View Profile
« Reply #14 on: July 27, 2010, 09:43:51 PM »

I see what you are saying now.  As long as they have positioned the tool location reasonably close to the required starting point that takes them toward the intended XY touch plate location it would save them from having to manually zero X & Y first.  I like that!
Logged

airnocker
airnocker
Active Member

Offline Offline

Posts: 36


View Profile
« Reply #15 on: July 27, 2010, 10:01:40 PM »

Thanks again Greg for the constructive suggestions. 

New revisions to the XY & Z sections now zero the axis DRO's prior to moving toward the touch plate.  The only prerequisite is the tool be positioned be less than +2" from the X touch plate face, less than +1" from the Y touch place face and less than +2" from the Z touch plate face.

The revised code now looks like this:

XYZ Auto Tool Zero Macro Version3.1 by airnocker


Sub Main()

Dim ConfirmReady As String
Dim DoXY As String
Dim DoZ As String

ConfirmReady = AskTextQuestion("Confirm Touch plate leads are connected and ready. (y/n)")
If ConfirmReady = "y" Then GoTo 1 Else GoTo 5


1:
DoXY = AskTextQuestion("Zero X and Y also? (y/n)")
If DoXY = "y" Then GoTo 2 Else GoTo 3


2:
Message( "Auto Zeroing X..." )
Call SetOEMDRO( 800, 0 )
Sleep 100
If IsSuchSignal (22) Then
   code "G31 X-2 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 800, .0625 )
                Sleep 100
   code "G1 X.5"
End If

Message( "Auto Zeroing Y..." )
Call SetOEMDRO( 801, 0 )
Sleep 100
If IsSuchSignal (22) Then
   code "G31 Y-1 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 801, .0625 )
   Sleep 100
   code "G1 Y.5"
End If

3:
DoZ = AskTextQuestion("Position the touch plate to zero Z.  y  to continue or n to skip.  (y/n)")
If DoZ = "y" Then GoTo 4 Else GoTo 6

4:
Message( "Auto Zeroing Z..." )
Call SetOEMDRO( 802, 0 )
Sleep 100
If IsSuchSignal (22) Then
   code "G31 Z-2 F10"
   While IsMoving()
   Sleep 100
   Wend
   Call SetOEMDRO( 802, .180 )
   Sleep 100
   code "G1 Z1"
End If
GoTo 6

5:
Message ("Tool zeroing aborted.  Try again when ready.")
GoTo 7

6:
Message "Tool zeroing complete.  Check the results on the DROs."

7:
End Sub
End
Logged

airnocker
Pages: « 1 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!