From 424a01bf0737690cacc255e423b0a10a3ed61bf9 Mon Sep 17 00:00:00 2001 From: Michele Cattafesta Date: Mon, 22 Dec 2014 14:40:06 +0100 Subject: [PATCH] [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 --- S7.Net/PLC.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/S7.Net/PLC.cs b/S7.Net/PLC.cs index 92601cf..55e037d 100644 --- a/S7.Net/PLC.cs +++ b/S7.Net/PLC.cs @@ -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;