Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: first off on August 25, 2016, 06:05:33 PM

Title: Auto-z macro to use input1 instead of probe input
Post by: first off 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.
Title: Re: Auto-z macro to use input1 instead of probe input
Post by: ger21 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.
Title: Re: Auto-z macro to use input1 instead of probe input
Post by: first off 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?
Title: Re: Auto-z macro to use input1 instead of probe input
Post by: TPS on August 26, 2016, 01:39:15 AM
to use a macro function instead G31 will allways be to slow-
Title: Re: Auto-z macro to use input1 instead of probe input
Post by: ger21 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.