Merge pull request #390 from mycroes/byte-length-bits

Fix byte length calculation for VarType.Bit
This commit is contained in:
Michael Croes
2021-05-10 20:32:34 +02:00
committed by GitHub

View File

@@ -184,7 +184,7 @@ namespace S7.Net
switch (varType)
{
case VarType.Bit:
return varCount + 7 / 8;
return (varCount + 7) / 8;
case VarType.Byte:
return (varCount < 1) ? 1 : varCount;
case VarType.String: