Esempio n. 1
0
 //解析报警设置
 public static xd100x.alarmt Read_alarmt(byte[] inByte)
 {
     xd100x.alarmt at = new xd100x.alarmt();
     at._yicigdiwen  = DataInfo.GetLongValue2(inByte, 3);
     at._erciggaowen = DataInfo.GetLongValue2(inByte, 5);
     at._waterlow    = (float)Math.Round(DataInfo.GetLongValue2(inByte, 7) / 100.0, 2);
     at._waterhight  = (float)Math.Round(DataInfo.GetLongValue2(inByte, 9) / 100.0, 2);
     return(at);
 }
Esempio n. 2
0
 //解析报警设置温度液位
 public static xd100x.alarmt Read_alarmt(byte[] inByte)
 {
     xd100x.alarmt at = new xd100x.alarmt();
     at._yicigdiwen  = Convert.ToInt16(DataInfo.GetFloatValue(inByte, 8));
     at._erciggaowen = Convert.ToInt16(DataInfo.GetFloatValue(inByte, 12));
     at._waterhight  = DataInfo.GetFloatValue(inByte, 16);
     at._waterlow    = DataInfo.GetFloatValue(inByte, 20);
     return(at);
 }
Esempio n. 3
0
 //设置报警温度液位
 public static byte[] Set_alarmt(byte address, xd100x.alarmt at)
 {
     byte[] t1     = BitConverter.GetBytes(at._yicigdiwen);
     byte[] t2     = BitConverter.GetBytes(at._erciggaowen);
     byte[] t3     = BitConverter.GetBytes(at._waterlow);
     byte[] t4     = BitConverter.GetBytes(at._waterhight);
     byte[] buffer = { 82, 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));
 }
Esempio n. 4
0
 //设置报警设置温度液位
 public static byte[] Set_alarmt(byte address, xd100x.alarmt at)
 {
     int[] buffer = { at._yicigdiwen, at._erciggaowen, Convert.ToInt16(at._waterlow * 100), Convert.ToInt16(at._waterhight * 100) };
     return(DataInfo.ModbusSetData(address, 0x10, 202, buffer));
 }