public ModbusMessage(byte _address, byte _function, byte[] _data) { address = _address; function = _function; data = _data; checksum = Crc16.GetChecksum(new byte[2] { address, function }.Concat(data).ToArray()); isFromMaster = false; }
public void RecalculateChecksum() { checksum = Crc16.GetChecksum(new byte[2] { address, function }.Concat(data).ToArray()); }