This commit is contained in:
罗圣
2016-09-01 10:51:30 +08:00
parent 2ddb028baf
commit b4f54d2f13

View File

@@ -81,7 +81,7 @@ namespace Modbus.Net
{
Area = area,
Address = (int) Math.Floor(initNum),
GetCount = (int)Math.Ceiling((Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(address.Area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
GetCount = (int)Math.Ceiling((preNum - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(address.Area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
DataType = typeof (byte),
OriginalAddresses = originalAddresses.ToList(),
});
@@ -101,7 +101,7 @@ namespace Modbus.Net
{
Area = area,
Address = (int)Math.Floor(initNum),
GetCount = (int)Math.Ceiling((Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
GetCount = (int)Math.Ceiling((preNum - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
DataType = typeof (byte),
OriginalAddresses = originalAddresses.ToList()
});