[Breaking change]: DBW and DBD now returns unsigned short and unsigned int. This because the conversion that was used previously was loosing both negative values and values over maximum of int.

Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
This commit is contained in:
Michele Cattafesta
2014-12-22 14:40:06 +01:00
parent d1162480a7
commit 424a01bf07

View File

@@ -352,10 +352,10 @@ namespace S7.Net
byte obj = (byte)Read(DataType.DataBlock, mDB, dbIndex, VarType.Byte, 1);
return obj;
case "DBW":
Int16 objI = (Int16)(UInt16)Read(DataType.DataBlock, mDB, dbIndex, VarType.Word, 1);
UInt16 objI = (UInt16)Read(DataType.DataBlock, mDB, dbIndex, VarType.Word, 1);
return objI;
case "DBD":
Int32 objU = (Int32)(UInt32)Read(DataType.DataBlock, mDB, dbIndex, VarType.DWord, 1);
UInt32 objU = (UInt32)Read(DataType.DataBlock, mDB, dbIndex, VarType.DWord, 1);
return objU;
case "DBX":
mByte = dbIndex;