//解析室外温度修正 public static xd100x.temprevise Read_temprevise(byte[] inByte) { xd100x.temprevise or = new xd100x.temprevise(); or._k = (float)Math.Round(DataInfo.GetLongValue2(inByte, 3) / 1000.0, 3); or._b = (float)Math.Round(DataInfo.GetLongValue2(inByte, 5) / 10.0, 1); return(or); }
//设置二次回温度修正 public static byte[] Set_BT2revise(byte address, xd100x.temprevise or) { byte[] t1 = BitConverter.GetBytes(or._max); byte[] t2 = BitConverter.GetBytes(or._min); byte[] t3 = BitConverter.GetBytes(or._k); byte[] t4 = BitConverter.GetBytes(or._b); byte[] buffer = { 35, or._channel, or._type, or._unit, t1[0], t1[1], t1[2], t1[3], t2[0], t2[1], t2[2], t2[3], t3[0], t3[1], t3[2], t3[3], t4[0], t4[1], t4[2], t4[3] }; return(DataInfo.SetData(address, 21, buffer)); }
//解析温度修正 public static xd100x.temprevise Read_temprevise(byte[] inByte) { xd100x.temprevise or = new xd100x.temprevise(); or._channel = DataInfo.GetByteValue(inByte, 8); or._type = DataInfo.GetByteValue(inByte, 9); or._unit = DataInfo.GetByteValue(inByte, 10); or._max = DataInfo.GetFloatValue(inByte, 11); or._min = DataInfo.GetFloatValue(inByte, 15); or._k = DataInfo.GetFloatValue(inByte, 19); or._b = DataInfo.GetFloatValue(inByte, 23); return(or); }
//设置二次回温度修正 public static byte[] Set_BT2revise(byte address, xd100x.temprevise or) { int[] buffer = { Convert.ToInt16(or._k * 1000), Convert.ToInt16(or._b * 10) }; return(DataInfo.ModbusSetData(address, 0x10, 32, buffer)); }