Abbott Standard Interface RS-232 Manual/雅培标准接口RS - 232手册中的ASTM通讯协议,用到的串口通讯校验方法。
这里只提供,将需要校验的字符串数组,转换成校验数据,然后返回待发送的byte数组。
public List<byte[]> GetRetMsgList(params string[] dataArr)
{
// 返回消息的初始化
List<byte[]> retMsgList = new List<byte[]>();
List<byte[]> retList = new List<byte[]>();
for (int i = 0; i < dataArr.Length; i++)
{
retMsgList.Add(Encoding.ASCII.GetBytes(dataArr[i]));
}