Hey David,
I would try the second example, it is made for the Onefinity Touch probe.
It is made for the case where you touchprobe on your workpiece top (=part zero is on workpiece top). Should you touchprobe on the machine bed (=part zero is at wasteboard height =at workpiece bottom), simply remove the “G0 X0 Y0
” line. Probing will then be done at machine home position.