(Procedure for Finding zero and synchronize )
(dual x-axis )
( M81 - plc procedure, that fork process to motion & plc; resume motion )
( watching for sensors limit_x1 & limit_x2 )
( when one of sensors activated - it turn-off coincident axis )
( when both sensors activated - it turn-on them back and skip running )
( current motion linecurrentturn on watching for zero-sensors - plc procedure M81)


G10 L80 P5521 Q1
G10 L80 P5525 Q1

(P0 - X1+ X2+ normal direction for X1&X2)
(P3 - X1- X2- inverted direction for X1&X2)
(P1 - X1+ X2- normal direction for X1 and inverted for X2)
(P2 - X1- X2+ normal direction for X2 and inverted for X1)

N40 M81 P1
(watching for limit_x1 & limit_x2 sensors and turn off X1/X2 axes, break if both are ready)
G91 G0 X -500 F100. (after fork in the M81 procedure this motion will be running simultaneously with the M81 )

G04 P1.0 ( pause to apply new settings )

(move out from the sensors for 10 mm)
(N50 G91 G0 X 10 F100.)

(turn ON back watching for limit sensors)
G10 L80 P5521 Q0
G10 L80 P5525 Q0

(reset X axis .... and unused ABC axes)
G90 G10 L70 P0 X0 A0B0C0

M02


