<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encoder_read(self, pin):
 """ This method retrieves the latest encoder data value. It is a FirmataPlus feature. :param pin: Encoder Pin :returns: encoder data value """

        try:
            task = asyncio.ensure_future(self.core.encoder_read(pin))
            value = self.loop.run_until_complete(task)
            return value
        except RuntimeError:
            self.shutdown()