Fix ByteLength calculation for S7Strings when reserved is odd

This commit is contained in:
diego
2021-03-15 19:56:22 +01:00
committed by Michael Croes
parent b4b94e1777
commit e63d92c61c

View File

@@ -190,7 +190,7 @@ namespace S7.Net
case VarType.String:
return varCount;
case VarType.S7String:
return varCount + 2;
return ((varCount + 2) & 1) == 1 ? (varCount + 3) : (varCount + 2);
case VarType.S7WString:
return (varCount * 2) + 4;
case VarType.Word: