//读取数据域 public static byte[] GetData(ReadBuffer.Parameter para) { byte [] tempdata; List <byte> _tempdata = new List <byte>(); _tempdata.Add((byte)para.startpoint); _tempdata.Add((byte)(para.startpoint >> 8)); _tempdata.Add((byte)para.stoppoint); _tempdata.Add((byte)(para.stoppoint >> 8)); tempdata = _tempdata.ToArray <byte>(); return(tempdata); }
/// <summary> /// 读H2O采样缓存 /// </summary> /// <param name="destid"></param> /// <param name="data"></param> /// <returns></returns> public static byte[] ReadH2OCache(byte destid, ReadBuffer.Parameter para) { byte[] donedata; byte[] data = GetData(para); PrepareData.Msg_Bus _frame = new PrepareData.Msg_Bus(); _frame.flag = PrepareData.BUS_FRAME_FLAG; _frame.srcID = MSGEncoding.srcID; _frame.destID = destid; _frame.msgDir = (byte)MSGEncoding.MsgDir.Request; _frame.msgVer = MSGEncoding.msgVer; _frame.msgType = (byte)MSGEncoding.MsgType.ReadBuffer; _frame.msgSubType = (byte)MSGEncoding.ReadBuffer.ReadH2OCache; _frame.dataLen = (ushort)data.Length; donedata = PrepareData.MergeMsg(ref _frame, data); return(donedata); }