The main difference between the hardware and software modes for the PROBE command is how the input state is detected. In software mode, the SMC (running on the PC) detects the change in the input and signals each of the specified drives to latch their position. This only requires the touch probe to be connected to a single drive regardless of how many positions you want to capture, but the latency is increased due to the communication with the PC. In the hardware mode, on the other hand, the input state is detected by the drive firmware, thus eliminating the communication latency. The downside of this is that, if you want to capture the position of multiple axes, the touch probe must then be connected to each drive on which you wish to capture the position.
There are two differences in the way that the hardware mode is configured compared to the software mode. First, you need to change the PROBE MODE command to use PROBE_HW_MODE instead of PROBE_SW_MODE. Second, if you want to capture the position of multiple axes, you will also need to use the PROBE INPUT command on each axis to specify the input that will be used for monitoring the touch probe. The remaining configuration (i.e., the G51 command) will remain the same for both modes.
For example, the following configuration using software mode captures the position on axes X, Y, and Z:
PROBE MODE PROBE_SW_MODE 1 $Global[0]
PROBE INPUT PROBE_INPUT_DRIVE_DIGITAL X 3
G51 X Y Z
To capture the same data using hardware mode, the following code would be used:
PROBE MODE PROBE_HW_MODE 1 $Global[0]
PROBE INPUT PROBE_INPUT_DRIVE_DIGITAL X 3
PROBE INPUT PROBE_INPUT_DRIVE_DIGITAL Y 3
PROBE INPUT PROBE_INPUT_DRIVE_DIGITAL Z 3
G51 X Y Z