2015-07-08 update 1

This commit is contained in:
parallelbgls@outlook.com
2015-07-09 10:12:59 +08:00
parent a0e1009e4e
commit 277702b050
2 changed files with 2 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ namespace ModBus.Net
p => p.Area == communicateAddress.Area && p.Address == pos + communicateAddress.Address); p => p.Area == communicateAddress.Area && p.Address == pos + communicateAddress.Address);
if (address != null) if (address != null)
{ {
ans.Add(address.CommunicationTag, new ReturnUnit{PlcValue = String.Format("{0:#0.#}", Math.Round(Single.Parse(ValueHelper.Instance.GetValue(datas, ref pos, address.DataType).ToString()) * address.Zoom, 3)),UnitExtend = address.UnitExtend}); ans.Add(address.CommunicationTag, new ReturnUnit{PlcValue = Math.Round(Single.Parse(ValueHelper.Instance.GetValue(datas, ref pos, address.DataType).ToString()) * address.Zoom, address.DataType == typeof(System.Single) || address.DataType == typeof(System.Double) ? 3 : (Math.Log10(address.Zoom) > 0 ? 0 : (int)Math.Ceiling(-Math.Log10(address.Zoom)))).ToString(),UnitExtend = address.UnitExtend});
} }
else else
{ {

View File

@@ -15,7 +15,7 @@ namespace ModBus.Net
protected TcpProtocalLinker(string ip, int port) protected TcpProtocalLinker(string ip, int port)
{ {
_baseConnector = new TcpConnector(ip, port, 30000); _baseConnector = new TcpConnector(ip, port, 2000);
} }
} }
} }