Hello Guest it is September 17, 2019, 05:32:35 PM

Author Topic: Auto-z macro to use input1 instead of probe input  (Read 1573 times)

0 Members and 1 Guest are viewing this topic.

Auto-z macro to use input1 instead of probe input
« on: August 25, 2016, 06:05:33 PM »
Hey guys I need some help with this auto-z macro. I want to use input 1 instead of probe and I do not know what to change. Here is the macro I use now using a probe input. And I know there is alot of discussion about auto-z macro's but I have not had any luck making this work myself.

'Auto tool calibration to fixture z field Sept 10/2015
'input probe pin15 port 1
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = GetUserDRO(1151) 'You could put your z-plate thickness here instead
'ProbeFeed = GetUserDRO(1152) 'You could put a probing feedrate here instead.

If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G4 P3" 'Time to get to the z-plate, 3 seconds
Code "G90 G31 Z-2 F4." 'probing move, can set the feed rate here as well as how far to move
While IsMoving()
Wend
ZProbePos = GetVar(2002)
Code "G1 Z" &ZProbePos
While IsMoving ()
Wend
'Call SetDro (2, PlateThickness)
Call SetDRO(2, Abs(GetOEMDRO(1001)))
Code "G4 P1.0" 'Pause for Dro to update.
Code "G0 G91 Z1.0" 'Change the Z retract height here to what you want, must be higher than touch plate
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed 'returns to prior feedrate
Else
Code "(Z-Plate is grounded, check connection and try again)"
End If
Exit Sub   

As always I appreciate your help and time.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto-z macro to use input1 instead of probe input
« Reply #1 on: August 25, 2016, 10:40:53 PM »
Quote
I want to use input 1 instead of probe

G31 only works with the probe input.
The only thing you can do is create a Brain that triggers the Probe input when Input #1 is triggered.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Auto-z macro to use input1 instead of probe input
« Reply #2 on: August 25, 2016, 11:17:23 PM »
yes l understand that G31 is a probe input. How do I change it so that it does not use a G31 or a probe and uses input1 instead?

Offline TPS

*
  •  1,388 1,388
    • View Profile
Re: Auto-z macro to use input1 instead of probe input
« Reply #3 on: August 26, 2016, 01:39:15 AM »
to use a macro function instead G31 will allways be to slow-
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: Auto-z macro to use input1 instead of probe input
« Reply #4 on: August 26, 2016, 05:37:56 AM »
yes l understand that G31 is a probe input. How do I change it so that it does not use a G31 or a probe and uses input1 instead?

You can't.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html