From df019ac1938a72ef0a5fa711d24ddf921276bb60 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Thu, 7 Jul 2016 11:06:14 +0100 Subject: [PATCH] GetClassSize return zero. Issue #61. --- S7.Net.Core/PLC.cs | 2 +- S7.Net/PLC.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);