Files
Modbus.Net/NA200H/ModBus.Net/ModbusTcpProtocalLinker.cs
parallelbgls@outlook.com ca030c8f59 2014-08-27 update 1
2014-08-27 15:57:25 +08:00

35 lines
767 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ModBus.Net
{
public class ModbusTcpProtocalLinker : TcpProtocalLinker
{
public override bool CheckRight(byte[] content)
{
if (content[5] != content.Length - 6)
{
throw new ModbusProtocalErrorException(500);
}
if (content[7] > 127)
{
throw new ModbusProtocalErrorException(content[2]);
}
return true;
}
public ModbusTcpProtocalLinker() : base()
{
}
public ModbusTcpProtocalLinker(string ip) : base(ip)
{
}
}
}