Hello Guest it is April 18, 2024, 01:09:12 AM

Author Topic: Auto-z macro to be active low signal instead of active high.  (Read 1710 times)

0 Members and 1 Guest are viewing this topic.

Auto-z macro to be active low signal instead of active high.
« on: August 26, 2016, 04:44:30 PM »
Ok i will ask another question. How do I make this auto-z macro work "active low" instead of "active high"? I am sure others have this same issue. I don't want to change the input setting when I go from my digitizing probe to my auto-z plate.

'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.