diff --git a/S7.Net.Core/PLC.cs b/S7.Net.Core/PLC.cs index c289a47..2d77a53 100644 --- a/S7.Net.Core/PLC.cs +++ b/S7.Net.Core/PLC.cs @@ -1011,7 +1011,7 @@ namespace S7.Net while (numBytes > 0) { var maxToRead = (int)Math.Min(numBytes, 200); - byte[] bytes = (byte[])Read(DataType.DataBlock, db, index, VarType.Byte, (int)maxToRead); + byte[] bytes = ReadBytes(DataType.DataBlock, db, index, maxToRead); if (bytes == null) return new List(); resultBytes.AddRange(bytes); diff --git a/S7.Net/PLC.cs b/S7.Net/PLC.cs index 2ab954a..2520485 100644 --- a/S7.Net/PLC.cs +++ b/S7.Net/PLC.cs @@ -1008,7 +1008,7 @@ namespace S7.Net while (numBytes > 0) { var maxToRead = (int)Math.Min(numBytes, 200); - byte[] bytes = (byte[])Read(DataType.DataBlock, db, index, VarType.Byte, (int)maxToRead); + byte[] bytes = ReadBytes(DataType.DataBlock, db, index, maxToRead); if (bytes == null) return new List(); resultBytes.AddRange(bytes);