protected override bool CheckReveicedDataBody(byte[] bytes) { if ((bytes[1] == 221) && (bytes[2].ToInt32() == DeviceNumber) && TLAutoPLCDeviceHelper.IsRightCRC(bytes, ResultByteLength)) { return(true); } return(false); }
protected override bool CheckReveicedDataBody(byte[] bytes) { if ((bytes[1] == 221) && TLAutoPLCDeviceHelper.IsRightCRC(bytes, ResultByteLength)) { return(true); } return(base.CheckReveicedDataBody(bytes)); }
public override byte[] GetSendData() { var commandParamsList = new List <object> { DeviceNumber.ToHex() }; var commandParams = GetReplaceCommandParams(); if (commandParams != null) { commandParamsList.AddRange(commandParams); } var commandText = string.Format(SendCommand, commandParamsList.ToArray()); if (HasSendCRC) { var crc = TLAutoPLCDeviceHelper.GetCRCFromHexs(commandText); commandText = commandText + " " + crc; } return(TLAutoDeviceHelper.HexStringToByteArray(commandText)); }