Oct-12-2016, 03:20 PM
It's not that I'm intent on not finding the problem string, it is that I've found the data I'm getting doesn't always follow the format Maxbotix specifies. I've seen results like 'R0000', 'RR1234', 'R324''(2 single quotes), etc. I even get inconsistent readings, ie R0899 then R4309 when the second read was milliseconds from the 1st. The posted code is just a snippet. The full code actually does 2 reads and if there's a greater than 10% difference I assume one is a bad read and wait for the next iteration to test for <1000 mm.
The hardware isn't 100% reliable. That may be caused by poor design, be it the manufacturer or the chassis it is installed in. Regardless, my task is to make it reliable.
In addition to the isnumeric I've added a few try/excepts to lock this down.
The hardware isn't 100% reliable. That may be caused by poor design, be it the manufacturer or the chassis it is installed in. Regardless, my task is to make it reliable.
In addition to the isnumeric I've added a few try/excepts to lock this down.