Beispiel #1
0
 public float?ReadFloat(String addr)
 {
     if (IsDoubleAddr(addr))
     {
         var recData = ReadAddr(ModbusFunCode.READ_REGISTER, 2, ConvertFatekAddrToModbusAddr(addr.Substring(1)));
         return(ByteUtil.BytesToSingle(recData[1], recData[2], recData[3], recData[4]));
     }
     else
     {
         ErrorMessage = "地址格式不正确";
         return(null);
     }
 }