/* Reads a data element from the input registers data table. 
Write the value of the input register in your CPUs native endianess. The MicroTBX-Modbus stack will automatically convert this to the big endianess that the Modbus protocol requires. Note that the element is specified by its zero-based address in the range 0 - 65535, not its element number (1 - 65536).  */
static tTbxMbServerResult AppReadInputReg(tTbxMbServer channel, uint16_t addr, uint16_t *value)
/* Reads a data element from the input registers data table. 
Write the value of the input register in your CPUs native endianess. The MicroTBX-Modbus stack will automatically convert this to the big endianess that the Modbus protocol requires. Note that the element is specified by its zero-based address in the range 0 - 65535, not its element number (1 - 65536).  */
static tTbxMbServerResult AppReadInputReg(tTbxMbServer channel, uint16_t addr, uint16_t *value)
{
  tTbxMbServerResult result = TBX_MB_SERVER_OK;
  TBX_UNUSED_ARG(channel);
  switch (addr)
  {
  case 30000U:
    *value = (uint16_t)TimerGet();
    break;
  case 30001U:
    *value = 12345;
    break;
  default:
    result = TBX_MB_SERVER_ERR_ILLEGAL_DATA_ADDR;
    break;
  }
  return result;
}