Thanks for this. I have added the debounce function but it didn't didn't fix the problem. I am going to keep it as it looks like a good practice.
I don't have the settings you have in the ini file. However, the probe screen I am using has a separate file, "probe_screen.pref", where it keeps the preferences. Nothing seems to be missing.
I have checked the input signal in Halshow, and I can see the signal is going ON on the first approach at search velocity, but I don't see a second signal at probing velocity. The program just concludes the measurement and uses the value from the search velocity.
I am starting to think it is some kind of bug in a macro, but if that is the case, I am sure others would experience it as well.
I am using the probe screen v2.9 from this git repository:
github.com/verser-git/probe_screen_v2.9
Here are my settings for the probe screen and a macro to measure X- position (I hope it is the correct one). Perhaps someone can spot what is wrong:
####Config file#####
[DEFAULT]
chk_signal_delay = False
ps_signal_delay = 1.5
chk_use_fine = False
chk_error_signal = False
chk_auto_rott = False
ps_offs_angle = 0.0
chk_set_zero = False
chk_arm_enable = False
enbl_remap_m6 = True
ps_metric_mode = True
ps_searchvel = 100.0
ps_probevel = 10.0
ps_z_clearance = 4.0
ps_probe_max = 15.0
ps_probe_latch = 10.0
ps_probe_diam = 1.915
ps_xy_clearance = 5.0
ps_edge_length = 5.0
ps_offs_x = 0.07874015748031495
ps_offs_y = 0.079
ps_offs_z = 19.38
ps_arm_delta_x = 0.0
ps_arm_delta_y = 0.0
setterheight = -23.7225
blockheight = -71.445
#### Example Macro ####
o<psng_xminus> sub
; BEGIN PSNG PREAMBLE
M73 ; Save and autorestore model states. This will be used only in case of error, otherwise we will invalidate it.
o<_psng_modal_save> call
o<_psng_hook> call [6]
; END PSNG PREAMBLE
; Save starting X position
#<x>=#<_x>
; Ensure we're in G90 / absolute mode
G90
; Probe X Minus
o<_psng_probe_x> call [-#<_hal[probe.ps_probe_max]>]
O1 if [#<_value> EQ -1]
M72 ; Restore modal state
(ABORT, Probe already tripped when starting G38.3 move)
O1 else if [#<_value> EQ -2]
M72 ; Restore modal state
(ABORT, Probe failed to make contact with workpiece)
O1 else if [#<_value> EQ -3]
M72 ; Restore modal state
(ABORT, Probe failed to make contact without ERR signal)
O1 endif
; Move back to starting X position
G1 X#<x> F#<_ini[TOOLSENSOR]RAPID_SPEED>
; BEGIN PSNG POSTAMBLE
M71 ; Invalidate Modal Autorestore
o<_psng_modal_restore> call
; END PSNG POSTAMBLE
o<psng_xminus> endsub
M2