I need a code for Z-axis homing value detection

Please check: How-To Ask for Help