(Surface measure macro)
(Tool is placed somewhere above the surface sensor)
(#5490 - Surface Sensor Width)
(#5494 - Surface Sensor Number)
(#5495 - Surface Sensor Type - Open/Closed)
(#5496 - Sheet material thickness)
G28.2 Z0 (save current Z into Register1.Z)
M89 L1 P#5494
(watch for given sensor (P) pressed(L1))
G91 G0 Z -30.000 F  30.0
(move down, stop if sensor triggered)
G4 P0.05
G90 G10 L70 P1 Z [ #5490 - #5496 ]
(set current work position as 0, depends on surface sensor width & sheet thickness)
G4 P0.05
(#5431...#5438 - Work area Max)
G53 G0 Z[#5433-1.0] F3000.0(Move up to top position)
