An example is provided with a simple function to read through serial pin (pin5) of Maxbotix ultrasonic sensor. Serial pin is the most accurate output of Maxbotix sensors (source: pin5 description of sensor datasheet, page 2). Hence, reading of just this pin is considered.
The example is self-explanatory and easy to follow.
It is tested and working with HRXL sensor and will be working with other models as long as serial output pattern is the same. In this example it is supposed that sensor is always powered on.