Merge pull request #62 from watashimeandeu/master

Fixes bug on ReadMultipleBytes: when readying one byte now it returns byte[] instead of byte.
This commit is contained in:
Michele Cattafesta
2016-07-07 13:33:13 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -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<byte>();
resultBytes.AddRange(bytes);

View File

@@ -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<byte>();
resultBytes.AddRange(bytes);