Hello Guest it is November 14, 2019, 09:42:25 PM

Author Topic: Modifing Operator Editable Button Macros  (Read 17114 times)

0 Members and 1 Guest are viewing this topic.

Re: Modifing Operator Editable Button Macros
« Reply #10 on: July 27, 2010, 06:48:43 PM »
Here is the other picture that would not upload in my last post.
airnocker

Everything depends on everything else

Offline Greolt

*
  •  956 956
    • View Profile
Re: Modifing Operator Editable Button Macros
« Reply #11 on: July 27, 2010, 09: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. :)

Greg
« Last Edit: July 27, 2010, 09:25:19 PM by Greolt »
Re: Modifing Operator Editable Button Macros
« Reply #12 on: July 27, 2010, 09: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

airnocker

Everything depends on everything else

Offline Greolt

*
  •  956 956
    • View Profile
Re: Modifing Operator Editable Button Macros
« Reply #13 on: July 27, 2010, 10: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. :)

Greg
Re: Modifing Operator Editable Button Macros
« Reply #14 on: July 27, 2010, 10: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!
airnocker

Everything depends on everything else
Re: Modifing Operator Editable Button Macros
« Reply #15 on: July 27, 2010, 11: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
airnocker

Everything depends on everything else

Offline yemil

*
  •  21 21
    • View Profile
Re: Modifing Operator Editable Button Macros
« Reply #16 on: April 17, 2018, 11:39:58 PM »
hi i tried the script  on my 3040 cnc..

the tip  moved ..very slowly on each direction and back ...without touching the plate...

Re: Modifing Operator Editable Button Macros
« Reply #17 on: April 18, 2018, 12:27:58 AM »
hi i tried the script  on my 3040 cnc..

the tip  moved ..very slowly on each direction and back ...without touching the plate...



Hi yemil,

Could you tell us more about your 3040 CNC machine and which version you are using of Mach?  I've been using this macro with Mach3  successfully for many years.  Let us know and we will try to help you.

airnocker

Everything depends on everything else

Offline yemil

*
  •  21 21
    • View Profile
Re: Modifing Operator Editable Button Macros
« Reply #18 on: April 18, 2018, 02:25:19 PM »
Thanks .. that was  fast... 

i have  a chinese  4030Z CNC    conected with usb  to my windows10 computer
the mach3  software that i am using ..i think is  sort of modified mach3 software to be run under usb conected computer
as i have read ... most CNC with mach3   run on older computers with LPT1 port.... so 
the software does not run many buttons as expected or seen in other youtube videos      i thought   i was alone ..
now   .. i am trying to decipher   this  g code and macro stuff ...
and  want to use the XYZ zero plate..

without any success at all....

can you help?...
what kind of info from my config  , do you need?

thanks in advance




Re: Modifing Operator Editable Button Macros
« Reply #19 on: April 18, 2018, 02:59:51 PM »
Thanks .. that was  fast... 

i have  a chinese  4030Z CNC    conected with usb  to my windows10 computer
the mach3  software that i am using ..i think is  sort of modified mach3 software to be run under usb conected computer
as i have read ... most CNC with mach3   run on older computers with LPT1 port.... so 
the software does not run many buttons as expected or seen in other youtube videos      i thought   i was alone ..
now   .. i am trying to decipher   this  g code and macro stuff ...
and  want to use the XYZ zero plate..

without any success at all....

can you help?...
what kind of info from my config  , do you need?

thanks in advance



I believe you just described the problem. :-(  The USB break-out-board you are using (let me know which one it is, too) may not be able to emulate the LPT port functions or requires some "tweaking" in order to work with my zero touch-plate macro.  I use a computer that has a legacy LPT parallel port and a CNC4PC C1R10.1 BOB (Break-Out-Board)  https://cnc4pc.com/catalog/product/view/id/3/s/c1-parallel-port-interface-card/category/156/ .

We need to make sure you are using a USB break-out-board that emulates the parallel port's input and output pins.
airnocker

Everything depends on everything else