Exemple #1
0
 //设置调节阀温度曲线
 public static byte[] Set_valveline(byte address, xd100x.valveline vl)
 {
     byte[] buffer = { (byte)Convert.ToSByte(vl._ov1), (byte)Convert.ToSByte(vl._gv1),
                       (byte)Convert.ToSByte(vl._ov2), (byte)Convert.ToSByte(vl._gv2),
                       (byte)Convert.ToSByte(vl._ov3), (byte)Convert.ToSByte(vl._gv3),
                       (byte)Convert.ToSByte(vl._ov4), (byte)Convert.ToSByte(vl._gv4),
                       (byte)Convert.ToSByte(vl._ov5), (byte)Convert.ToSByte(vl._gv5),
                       (byte)Convert.ToSByte(vl._ov6), (byte)Convert.ToSByte(vl._gv6),
                       (byte)Convert.ToSByte(vl._ov7), (byte)Convert.ToSByte(vl._gv7),
                       (byte)Convert.ToSByte(vl._ov8), (byte)Convert.ToSByte(vl._gv8) };
     return(DataInfo.SetData(address, 0x3c, buffer));
 }
Exemple #2
0
 //解析曲线
 public static xd100x.valveline Read_valveline(byte[] inByte)
 {
     xd100x.valveline vl = new xd100x.valveline();
     vl._ov1 = DataInfo.GetLongValue2(inByte, 3);
     vl._gv1 = DataInfo.GetLongValue2(inByte, 5);
     vl._ov2 = DataInfo.GetLongValue2(inByte, 7);
     vl._gv2 = DataInfo.GetLongValue2(inByte, 9);
     vl._ov3 = DataInfo.GetLongValue2(inByte, 11);
     vl._gv3 = DataInfo.GetLongValue2(inByte, 13);
     vl._ov4 = DataInfo.GetLongValue2(inByte, 15);
     vl._gv4 = DataInfo.GetLongValue2(inByte, 17);
     vl._ov5 = DataInfo.GetLongValue2(inByte, 19);
     vl._gv5 = DataInfo.GetLongValue2(inByte, 21);
     vl._ov6 = DataInfo.GetLongValue2(inByte, 23);
     vl._gv6 = DataInfo.GetLongValue2(inByte, 25);
     vl._ov7 = DataInfo.GetLongValue2(inByte, 27);
     vl._gv7 = DataInfo.GetLongValue2(inByte, 29);
     vl._ov8 = DataInfo.GetLongValue2(inByte, 31);
     vl._gv8 = DataInfo.GetLongValue2(inByte, 33);
     return(vl);
 }
Exemple #3
0
 //解析曲线
 public static xd100x.valveline Read_valveline(byte[] inByte)
 {
     xd100x.valveline vl = new xd100x.valveline();
     vl._ov1 = (sbyte)DataInfo.GetByteValue(inByte, 8);
     vl._gv1 = (sbyte)DataInfo.GetByteValue(inByte, 9);
     vl._ov2 = (sbyte)DataInfo.GetByteValue(inByte, 10);
     vl._gv2 = (sbyte)DataInfo.GetByteValue(inByte, 11);
     vl._ov3 = (sbyte)DataInfo.GetByteValue(inByte, 12);
     vl._gv3 = (sbyte)DataInfo.GetByteValue(inByte, 13);
     vl._ov4 = (sbyte)DataInfo.GetByteValue(inByte, 14);
     vl._gv4 = (sbyte)DataInfo.GetByteValue(inByte, 15);
     vl._ov5 = (sbyte)DataInfo.GetByteValue(inByte, 16);
     vl._gv5 = (sbyte)DataInfo.GetByteValue(inByte, 17);
     vl._ov6 = (sbyte)DataInfo.GetByteValue(inByte, 18);
     vl._gv6 = (sbyte)DataInfo.GetByteValue(inByte, 19);
     vl._ov7 = (sbyte)DataInfo.GetByteValue(inByte, 20);
     vl._gv7 = (sbyte)DataInfo.GetByteValue(inByte, 21);
     vl._ov8 = (sbyte)DataInfo.GetByteValue(inByte, 22);
     vl._gv8 = (sbyte)DataInfo.GetByteValue(inByte, 23);
     return(vl);
 }
Exemple #4
0
 //设置调节阀温度曲线
 public static byte[] Set_valveline(byte address, xd100x.valveline vl)
 {
     int[] buffer = { vl._ov1, vl._gv1, vl._ov2, vl._gv2, vl._ov3, vl._gv3, vl._ov4, vl._gv4, vl._ov5, vl._gv5, vl._ov6, vl._gv6, vl._ov7, vl._gv7, vl._ov8, vl._gv8 };
     return(DataInfo.ModbusSetData(address, 0x10, 117, buffer));
 }