plugin too fast?

Anyone doing probing in a plugin ever seen this? After a probe that triggers the input, var 5060 is occasionally returning 1, which is stopping my probing routine. I was seeing this about 1 out of 10 times, maybe even more? My only thought is that the UC.Getvar was happening before the VAR was actually updated? I added a UC.Wait(100) after the probe move, and it seemed to help, but it did happen again one time. I'm going to try increasing the wait to 250ms and see if that fixes it. I'm testing with an AXBB-E on me desk, using a pushbutton for the probe input. The probe move is 12", and I push the button as soon as it starts probing, and the messagebox opens immediately. Everything else seems to be working perfectly.
If I can't resolve this, I may just need to remove the code that checks the probe was good.
Using 2.115, but if I keep seeing this, I'll try an older version later today.
If I can't resolve this, I may just need to remove the code that checks the probe was good.
Using 2.115, but if I keep seeing this, I'll try an older version later today.
- Code: Select all
gcodestr = "G31 Z" + CStr(znew) + " F" + CStr(FirstProbeFeed) ' First Probe Move
Call MyProcThread()
ProbeFinished = UC.Getvar(5060)
If ProbeFinished = 1 Then
MessageBox.Show("Probing move completed without triggering input." + Environment.NewLine + "If no contact was made, increase Probe Distance and try again." + Environment.NewLine + "If contact was made, verify that probe input is functioning properly.", "Probing Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
UC.AddStatusmessage("Probing failed - Auto Zero aborted")
gcodestr = "F" + CStr(CurrentFeed) : Call MyProcThread() ' Reset Feedrate
Call RestoreScale()
Exit Select
End If